Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateB...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-09  Dean Jackson  <dino@apple.com>
2
3         Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters
4         https://bugs.webkit.org/show_bug.cgi?id=193309
5         <rdar://problem/45279224>
6
7         Reviewed by Antoine Quint.
8
9         A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters.
10
11         The crash log indicates we crash in a Checked<> class that is not recording
12         overflow i.e. it is crashing due to an overflow. The only place in this function
13         where that could happen is when we convert the FloatRect for the backdrop
14         region into a Checked<unsigned> for width and height. This suggests that either
15         the width or height are negative, or the float values are too large for integers,
16         or the product of the two overflows.
17
18         Avoid this by using RecordOverflow, but also changing the code a little to
19         bail if the rectangle is incorrect.
20
21         * platform/graphics/ca/GraphicsLayerCA.cpp:
22         (WebCore::GraphicsLayerCA::updateBackdropFilters):
23
24 2019-01-10  Oriol Brufau  <obrufau@igalia.com>
25
26         [css-grid] Let abspos items reference implicit grid lines
27         https://bugs.webkit.org/show_bug.cgi?id=193313
28
29         Reviewed by Manuel Rego Casasnovas.
30
31         While they can't create new implicit grid lines, abspos items
32         can reference existing ones as clarified in
33         https://github.com/w3c/csswg-drafts/commit/511bb63
34
35         This patch makes WebKit match Blink, Firefox and Edge.
36
37         Tests: web-platform-tests/css/css-grid/abspos/grid-positioned-items-padding-001.html
38                web-platform-tests/css/css-grid/abspos/grid-positioned-items-unknown-named-grid-line-001.html
39
40         * rendering/RenderGrid.cpp:
41         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator const):
42         Remove argument from spanSizeForAutoPlacedItem call.
43         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid const):
44         Remove argument from spanSizeForAutoPlacedItem call.
45         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const):
46         Remove argument from spanSizeForAutoPlacedItem call.
47         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid const):
48         Remove argument from spanSizeForAutoPlacedItem call.
49         (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
50         Don't treat implicit grid lines as 'auto'.
51         * rendering/RenderGrid.h:
52         Remove unused gridPositionIsAutoForOutOfFlow.
53         * rendering/style/GridPositionsResolver.cpp:
54         (WebCore::adjustGridPositionsFromStyle):
55         Don't treat implicit grid lines as 'auto'.
56         Remove unused gridContainerStyle parameter.
57         (WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem):
58         Remove argument from adjustGridPositionsFromStyle call.
59         Remove unused gridContainerStyle parameter.
60         (WebCore::resolveGridPositionFromStyle):
61         Remove unnecessary assert that uses isValidNamedLineOrArea.
62         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
63         Remove argument from adjustGridPositionsFromStyle call.
64         * rendering/style/GridPositionsResolver.h:
65         Remove unused isValidNamedLineOrArea.
66         Remove unused parameter from spanSizeForAutoPlacedItem.
67
68 2019-01-09  Matt Rajca  <mrajca@apple.com>
69
70         Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
71         https://bugs.webkit.org/show_bug.cgi?id=193301
72
73         Reviewed by Jer Noble.
74
75         Instead of unconditionally enabling this with a compile-time flag, let clients
76         enable the quirk on a per-load basis.
77
78         Tests: added API tests in favor of the current layout test as this behavior is no
79                longer on by default unless a client opts in.
80
81         * html/MediaElementSession.cpp:
82         (WebCore::needsPerDocumentAutoplayBehaviorQuirk):
83         (WebCore::MediaElementSession::playbackPermitted const):
84         * loader/DocumentLoader.h:
85
86 2019-01-10  Zalan Bujtas  <zalan@apple.com>
87
88         [LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when computing vertical position
89         https://bugs.webkit.org/show_bug.cgi?id=193310
90
91         Reviewed by Antti Koivisto.
92
93         If the block inflow element has previous siblings with collapsed through vertical margins,
94         then this box's before margin could _indirectly_ collapse with the parent. Use the previous siblings
95         to check for margin collapsing.
96
97         Test: fast/block/block-only/collapsed-through-siblings.html
98
99         * layout/blockformatting/BlockFormattingContext.cpp:
100         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
101         * page/FrameViewLayoutContext.cpp:
102         (WebCore::layoutUsingFormattingContext):
103
104 2019-01-10  Alicia Boya García  <aboya@igalia.com>
105
106         [MSE][GStreamer] Use GRefPtr in AppendPipeline::pushNewBuffer()
107         https://bugs.webkit.org/show_bug.cgi?id=192934
108
109         Reviewed by Xabier Rodriguez-Calvar.
110
111         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
112         (WebCore::AppendPipeline::pushNewBuffer):
113         * platform/graphics/gstreamer/mse/AppendPipeline.h:
114         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
115         (WebCore::MediaSourceClientGStreamerMSE::append):
116
117 2019-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>
118
119         [FreeType] Color emoji not properly supported
120         https://bugs.webkit.org/show_bug.cgi?id=191976
121
122         Reviewed by Michael Catanzaro.
123
124         Always try to fallback to a colored font for emojis.
125
126         Test: platform/gtk/fonts/font-emoji-system-fallback.html
127
128         * platform/graphics/ComplexTextController.cpp:
129         (WebCore::advanceByCombiningCharacterSequence): Group regional indicators in pairs.
130         * platform/graphics/Font.cpp:
131         (WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
132         (WebCore::Font::systemFallbackFontForCharacter const): Pass PreferColoredFont::No to FontCache::systemFallbackForCharacters.
133         * platform/graphics/Font.h: Add IsForPlatformFont enum to replace the bool parameter in systemFallbackFontForCharacter().
134         * platform/graphics/FontCache.h:
135         * platform/graphics/FontCascadeFonts.cpp:
136         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
137         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
138         (WebCore::characterSequenceIsEmoji): Check whether the character sequence is an emoji.
139         (WebCore::FontCascade::fontForCombiningCharacterSequence const): In case of emojis try to fallback to a colored
140         font even if base font can render the emoji in black and white.
141         * platform/graphics/cocoa/FontCacheCoreText.cpp:
142         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored.
143         * platform/graphics/freetype/FontCacheFreeType.cpp:
144         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter.
145         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
146         (WebCore::FontPlatformData::FontPlatformData): Initialize m_isColorBitmapFont.
147         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
148         (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Moved from cross-platform file.
149         (WebCore::Font::platformSupportsCodePoint const): Add freetype implementation.
150         * platform/graphics/win/FontCacheWin.cpp:
151         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored.
152         * platform/text/CharacterProperties.h:
153         (WebCore::isEmojiKeycapBase):
154         (WebCore::isEmojiRegionalIndicator):
155         (WebCore::isEmojiWithPresentationByDefault):
156         (WebCore::isEmojiModifierBase):
157
158 2019-01-09  Antoine Quint  <graouts@apple.com>
159
160         [Web Animations] Audit Web Animations classes for memory reduction
161         https://bugs.webkit.org/show_bug.cgi?id=193195
162
163         Reviewed by Simon Fraser and Yusuke Suzuki.
164
165         The classes, enums and structs added to support Web Animations were not as memory-efficient as they could be. We now order
166         members in a way that reduces padding, use Markable<T, Traits> instead of Optional<T> where applicable, declare enums as uint8_t
167         and removed unnecessary members.
168
169         As a result, classes and structs have shrunk as follows:
170
171         WebAnimation: 256 > 216
172         DeclarativeAnimation: 392 > 344
173         CSSAnimation: 416 > 368
174         CSSTransition: 440 > 392
175         AnimationEffect: 88 > 72
176         KeyframeEffect: 208 > 184
177         AnimationPlaybackEvent: 104 > 88
178         EffectTiming: 72 > 64
179         ComputedEffectTiming: 136 > 112
180         AnimationTimeline: 264 > 248
181         DocumentTimeline: 496 > 464
182         OptionalEffectTiming: 112 > 80
183         BaseKeyframe: 32 > 24
184         ParsedKeyframe: 80 > 72
185         BaseComputedKeyframe: 40 > 32
186
187         * animation/AnimationEffect.h: Order members in decreasing size, except for m_fill and m_direction, which we put at the top to
188         save 8 bytes (2 bytes of padding instead of 4 before m_animation and saving 6 bytes of padding at the end).
189         * animation/AnimationPlaybackEvent.cpp:
190         (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
191         * animation/AnimationPlaybackEvent.h:
192         * animation/AnimationPlaybackEventInit.h:
193         * animation/AnimationTimeline.cpp:
194         (WebCore::AnimationTimeline::AnimationTimeline):
195         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
196         * animation/AnimationTimeline.h: We remove the m_classType member and instead make isDocumentTimeline() virtual.
197         (WebCore::AnimationTimeline::isDocumentTimeline const):
198         (): Deleted.
199         (WebCore::AnimationTimeline::classType const): Deleted.
200         * animation/CompositeOperation.h:
201         * animation/CompositeOperationOrAuto.h:
202         * animation/ComputedEffectTiming.h:
203         * animation/DeclarativeAnimation.cpp:
204         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
205         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
206         * animation/DeclarativeAnimation.h: We keep m_wasPending and m_previousPhase at the top to save some padding at the end.
207         * animation/DocumentTimeline.cpp:
208         (WebCore::DocumentTimeline::DocumentTimeline):
209         * animation/DocumentTimeline.h:
210         * animation/EffectTiming.h:
211         * animation/FillMode.h:
212         * animation/IterationCompositeOperation.h:
213         * animation/KeyframeEffect.cpp:
214         (WebCore::computeMissingKeyframeOffsets):
215         (WebCore::KeyframeEffect::create):
216         (WebCore::KeyframeEffect::KeyframeEffect):
217         * animation/KeyframeEffect.h:
218         * animation/OptionalEffectTiming.h:
219         * animation/PlaybackDirection.h:
220         * animation/WebAnimation.h:
221         * animation/WebAnimationUtilities.h:
222         (WebCore::WebAnimationsMarkableDoubleTraits::isEmptyValue):
223         (WebCore::WebAnimationsMarkableDoubleTraits::emptyValue):
224
225 2019-01-09  Ryosuke Niwa  <rniwa@webkit.org>
226
227         ThreadTimers should not store a raw pointer in its heap
228         https://bugs.webkit.org/show_bug.cgi?id=192975
229         <rdar://problem/46893946>
230
231         Reviewed by Geoffrey Garen.
232
233         Right now, ThreadTimers's heap data structure stores a raw pointer to TimerBase. In order to harden the timer code,
234         this patch replaces it with ThreadTimerHeapItem, a newly introduced struct, which effectively acks like
235         WeakReference<TimerBase*> as the timer heap and TimerBase both store RefPtr to it, and TimerBase's destructor clears
236         the raw pointer back to TimerBase*.
237
238         This approach was taken instead of an out-right adoptation of WeakPtr since the heap data structure requires each node
239         in the heap to have a fixed "priority" yet WeakPtr with no valid pointer back to TimerBase would effectively lose its
240         "priority" thereby corrupting the heap data structure. That is, each item in the heap must remember its fire time and
241         insertion order even when the underlying TimerBase had gone away (this should never happen but the whole point of this
242         hardening is to make it work even in the precense of such a bug).
243
244         This patch also moves the heap index in TimerBase to ThreadTimerHeapItem, and replaces the pointer to the heap vector
245         in TimerBase by a reference to ThreadTimers in ThreadTimerHeapItem. Note that ThreadTimers is a per-thread singleton.
246
247         The correctness of this hardening was tested by commenting out the call to stop() and !isInHeap() assertion in
248         TimerBase::~TimerBase() as well as the !isInHeap() assertion in ThreadTimerHeapItem::clearTimer() and observing that
249         layout tests run successfully without hitting any debug assertions.
250
251         No new tests since there should be no observable behavior difference.
252
253         * WebCore.xcodeproj/project.pbxproj: Export ThreadTimers.h as a private header since it's now included in Timer.h
254         * platform/ThreadTimers.cpp:
255         (WebCore::ThreadTimers::updateSharedTimer): Delete ThreadTimerHeapItem's with nullptr TimerBase* (TimerBase had
256         already been deleted). This should only happen when TimerBase's destructor failed to remove itself from the timer heap,
257         which should never happen.
258         (WebCore::ThreadTimers::sharedTimerFiredInternal): Ditto. Also removed the redundant code which had removed the timer
259         from the heap since setNextFireTime does the removal already.
260         * platform/ThreadTimers.h: Outdented the whole file.
261         (WebCore::ThreadTimers::timerHeap): We use Vector<RefPtr<ThreadTimerHeapItem>> instead of Vector<Ref<~>> since Ref<~>
262         doesn't have a copy constructor which is used by std::push_heap.
263         (WebCore::ThreadTimerHeapItem): Added.
264         (WebCore::ThreadTimerHeapItem::hasTimer const): Added.
265         (WebCore::ThreadTimerHeapItem::setNotInHeap): Added. ThreadTimerHeapItem uses unsigned -1 as the single value which
266         signifies the item not being in the heap instead of all negative values as in the old code in TimerBase.
267         (WebCore::ThreadTimerHeapItem::isInHeap const): Added.
268         (WebCore::ThreadTimerHeapItem::isFirstInHeap const): Added.
269         (WebCore::ThreadTimerHeapItem::timer): Added.
270         (WebCore::ThreadTimerHeapItem::clearTimer): Added.
271         (WebCore::ThreadTimerHeapItem::heapIndex const): Added.
272         (WebCore::ThreadTimerHeapItem::setHeapIndex): Added.
273         (WebCore::ThreadTimerHeapItem::timerHeap const): Added.
274         * platform/Timer.cpp:
275         (WebCore::threadGlobalTimerHeap): This function is now only used in assertions.
276         (WebCore::ThreadTimerHeapItem::ThreadTimerHeapItem): Added.
277         (WebCore::ThreadTimerHeapItem::create): Added.
278         (WebCore::TimerHeapPointer::TimerHeapPointer):
279         (WebCore::TimerHeapPointer::operator-> const):
280         (WebCore::TimerHeapReference::TimerHeapReference): Added a copy constructor.
281         (WebCore::TimerHeapReference::copyRef const): Added.
282         (WebCore::TimerHeapReference::operator RefPtr<ThreadTimerHeapItem>& const):
283         (WebCore::TimerHeapPointer::operator* const):
284         (WebCore::TimerHeapReference::operator=): Use move assignment operator.
285         (WebCore::TimerHeapReference::swapWith):
286         (WebCore::TimerHeapReference::updateHeapIndex): Extracted to share code between two verions of operator=.
287         (WebCore::swap):
288         (WebCore::TimerHeapIterator::TimerHeapIterator):
289         (WebCore::TimerHeapIterator::operator-> const):
290         (WebCore::TimerHeapLessThanFunction::compare): Added variants which take RefPtr<ThreadTimerHeapItem>.
291         (WebCore::TimerHeapLessThanFunction::operator() const):
292         (WebCore::TimerBase::TimerBase):
293         (WebCore::TimerBase::~TimerBase):Clear the raw pointer in ThreadTimerHeapItem.
294         (WebCore::TimerBase::stop):
295         (WebCore::TimerBase::nextFireInterval const):
296         (WebCore::TimerBase::checkHeapIndex const): Added the consistency check for other items in the heap.
297         (WebCore::TimerBase::checkConsistency const):
298         (WebCore::TimerBase::heapDecreaseKey):
299         (WebCore::TimerBase::heapDelete):
300         (WebCore::TimerBase::heapDeleteMin):
301         (WebCore::TimerBase::heapIncreaseKey):
302         (WebCore::TimerBase::heapInsert):
303         (WebCore::TimerBase::heapPop):
304         (WebCore::TimerBase::heapPopMin):
305         (WebCore::TimerBase::heapDeleteNullMin): Added. Used to delete ThreadTimerHeapItem which no longer has a valid TimerBase.
306         (WebCore::parentHeapPropertyHolds):
307         (WebCore::childHeapPropertyHolds):
308         (WebCore::TimerBase::hasValidHeapPosition const):
309         (WebCore::TimerBase::updateHeapIfNeeded): Tweaked the heap index assertion as heapIndex() itself would assert when called
310         on an item with an invalid (-1) heap index.
311         (WebCore::TimerBase::setNextFireTime): Create ThreadTimerHeapItem. Note m_heapItem is never cleared until this TimerBase
312         is deleted.
313         (WebCore::TimerHeapReference::operator TimerBase* const): Deleted.
314         * platform/Timer.h:
315         (WebCore::TimerBase): Replaced m_nextFireTime, m_heapIndex, m_heapInsertionOrder, and m_cachedThreadGlobalTimerHeap
316         by m_heapItem, RefPtr to an ThreadTimerHeapItem.
317         (WebCore::TimerBase::augmentFireInterval):
318         (WebCore::TimerBase::inHeap const):
319         (WebCore::TimerBase::nextFireTime const):
320         (WebCore::TimerBase::isActive const):
321         (WebCore::TimerBase:: const): Deleted.
322
323 2019-01-09  Alex Christensen  <achristensen@webkit.org>
324
325         REGRESSION(239737) iOS quicklook tests should not dereference null
326         https://bugs.webkit.org/show_bug.cgi?id=193307
327
328         Reviewed by Brent Fulgham.
329
330         The quicklook tests rely on ResourceHandle on iOS for some reason.
331         This is a problem we'll fix later, but for now keep them working by not crashing.
332
333         * platform/network/mac/ResourceHandleMac.mm:
334         (WebCore::ResourceHandle::createNSURLConnection):
335         (WebCore::ResourceHandle::start):
336         (WebCore::ResourceHandle::willSendRequest):
337         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
338         (WebCore::ResourceHandle::receivedCredential):
339
340 2019-01-09  Zalan Bujtas  <zalan@apple.com>
341
342         [Datalist] Crash when input with datalist is dynamically added.
343         https://bugs.webkit.org/show_bug.cgi?id=193012
344         <rdar://problem/45923457>
345
346         Reviewed by Brent Fulgham.
347
348         In certain cases (cloning, setAttribute), it's too early to check for the list attribute in createShadowSubtree
349         to see whether the input needs datalist related items. The list attribute is simply not set yet.
350         This patch only addresses the obvious crash. m_dataListDropdownIndicator clearly lacks proper lifecycle management (see webkit.org/b/193032). 
351
352         Test: fast/forms/datalist/datalist-crash-when-dynamic.html
353
354         * html/TextFieldInputType.cpp:
355         (WebCore::TextFieldInputType::createShadowSubtree):
356         (WebCore::TextFieldInputType::attributeChanged):
357         (WebCore::TextFieldInputType::createDataListDropdownIndicator):
358         * html/TextFieldInputType.h:
359
360 2019-01-09  Justin Fan  <justin_fan@apple.com>
361
362         [WebGPU] Fix vertex-buffer-triangle-strip test and small update to GPURenderPipeline
363         https://bugs.webkit.org/show_bug.cgi?id=193289
364
365         Reviewed by Dean Jackson.
366
367         Fix broken test after pipeline layouts were added, and a small refactoring to GPURenderPipeline to avoid
368         retaining its descriptor after creation.
369
370         * platform/graphics/gpu/GPURenderPipeline.h:
371         (WebCore::GPURenderPipeline::primitiveTopology const):
372         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
373         (WebCore::GPURenderPipeline::GPURenderPipeline):
374
375 2019-01-09  Devin Rousso  <drousso@apple.com>
376
377         Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open
378         https://bugs.webkit.org/show_bug.cgi?id=193284
379
380         Reviewed by Joseph Pecoraro.
381
382         No newe tests, as this is simply exposes a value.
383
384         * inspector/InspectorFrontendHost.idl:
385         * inspector/InspectorFrontendHost.h:
386         * inspector/InspectorFrontendHost.cpp:
387         (WebCore::InspectorFrontendHost::isBeingInspected): Added.
388
389 2019-01-09  Zalan Bujtas  <zalan@apple.com>
390
391         [LFC][BFC][MarginCollapsing] Add support for peculiar cases.
392         https://bugs.webkit.org/show_bug.cgi?id=192625
393
394         Reviewed by Antti Koivisto.
395
396         Implement some of the more peculiar cases like margin collpasing through multiple boxes etc.
397         Add ~100 new passing cases.
398
399         * layout/FormattingContextGeometry.cpp:
400         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
401         * layout/LayoutState.h:
402         (WebCore::Layout::LayoutState::hasFormattingState const):
403         * layout/MarginTypes.h:
404         * layout/blockformatting/BlockFormattingContext.cpp:
405         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
406         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
407         (WebCore::Layout::hasPrecomputedMarginBefore):
408         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
409         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
410         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
411         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
412         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
413         * layout/blockformatting/BlockFormattingContext.h:
414         (WebCore::Layout::BlockFormattingContext::blockFormattingState const):
415         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
416         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
417         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
418         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore): Deleted.
419         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter): Deleted.
420         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
421         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
422         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter):
423         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): Deleted.
424         * layout/blockformatting/BlockFormattingState.h:
425         (WebCore::Layout::BlockFormattingState::setPositiveAndNegativeVerticalMargin):
426         (WebCore::Layout::BlockFormattingState::hasPositiveAndNegativeVerticalMargin const):
427         (WebCore::Layout::BlockFormattingState::positiveAndNegativeVerticalMargin const):
428         (WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore):
429         (WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore):
430         (WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const):
431         * layout/blockformatting/BlockMarginCollapse.cpp:
432         (WebCore::Layout::hasClearance):
433         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
434         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
435         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
436         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
437         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
438         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
439         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
440         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSiblingMarginBefore):
441         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
442         (WebCore::Layout::computedPositiveAndNegativeMargin):
443         (WebCore::Layout::marginValue):
444         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter):
445         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
446         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
447         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
448         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
449         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
450         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
451         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
452         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore): Deleted.
453         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter): Deleted.
454         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
455         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
456         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
457         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
458         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore): Deleted.
459         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter): Deleted.
460         * layout/displaytree/DisplayBox.cpp:
461         (WebCore::Display::Box::Box):
462         * layout/displaytree/DisplayBox.h:
463         (WebCore::Display::Box::hasClearance const):
464         (WebCore::Display::Box::setEstimatedMarginBefore):
465         (WebCore::Display::Box::estimatedMarginBefore const):
466         (WebCore::Display::Box::setHasClearance):
467         (WebCore::Display::Box::invalidateEstimatedMarginBefore):
468         (WebCore::Display::Box::setVerticalMargin):
469         (WebCore::Display::Box::rectWithMargin const):
470         * layout/floats/FloatingContext.cpp:
471         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
472         * layout/inlineformatting/InlineFormattingContext.cpp:
473         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
474
475 2019-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
476
477         REGRESSION(r239156): [FreeType] fixed width, and synthetic bold/italic not correctly applied since r239156
478         https://bugs.webkit.org/show_bug.cgi?id=193276
479
480         Reviewed by Žan Doberšek.
481
482         FontCache::createFontPlatformData() is calling getFontPropertiesFromPattern() with the configure pattern instead
483         of the result one after the match.
484
485         * platform/graphics/freetype/FontCacheFreeType.cpp:
486         (WebCore::FontCache::createFontPlatformData):
487
488 2019-01-08  Dean Jackson  <dino@apple.com>
489
490         Blob references for System Previews don't get a correct file extension
491         https://bugs.webkit.org/show_bug.cgi?id=193268
492         <rdar://problem/47133037>
493
494         Reviewed by Tim Horton.
495
496         Apple platforms don't yet have a mapping from the USD MIME type to
497         file extensions (and we support some non-standard MIME types), which
498         means that downloads from Blob references don't get correctly named.
499
500         Fix this by adding an explicit mapping between System Preview types
501         and ".usdz".
502
503         WebKit API test: _WKDownload.SystemPreviewUSDZBlobNaming
504
505         * platform/MIMETypeRegistry.cpp:
506         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): Remove USE(SYSTEM_PREVIEW) since
507         this applies to macOS and iOS now.
508         * platform/MIMETypeRegistry.h:
509         * platform/cocoa/MIMETypeRegistryCocoa.mm:
510         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Add a mapping
511         for USDZ.
512
513 2019-01-08  Tim Horton  <timothy_horton@apple.com>
514
515         Editable images sometimes don't become focused when tapped
516         https://bugs.webkit.org/show_bug.cgi?id=193259
517         <rdar://problem/47038424>
518
519         Reviewed by Wenson Hsieh.
520
521         Often when tapping an editable image inside an editable text area, the
522         text area's selection will change instead of focusing the editable image.
523
524         No new tests; I have had no luck writing a test that reliably failed 
525         beforehand (the "sometimes" is a problem).
526
527         * html/HTMLImageElement.cpp:
528         (WebCore::HTMLImageElement::defaultEventHandler):
529         * html/HTMLImageElement.h:
530         Override mousedown on editable images, focus the image, and prevent
531         the default behavior.
532
533 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
534
535         [WebAuthN] Support U2F HID Authenticators on macOS
536         https://bugs.webkit.org/show_bug.cgi?id=191535
537         <rdar://problem/47102027>
538
539         Reviewed by Brent Fulgham.
540
541         This patch changes U2fCommandConstructor to produce register commands with
542         enforcing test of user presence. Otherwise, authenticators would silently
543         generate credentials. It also renames readFromU2fSignResponse to
544         readU2fSignResponse.
545
546         Tests: http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html
547                http/wpt/webauthn/public-key-credential-create-failure-u2f.https.html
548                http/wpt/webauthn/public-key-credential-create-success-u2f.https.html
549                http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https.html
550                http/wpt/webauthn/public-key-credential-get-failure-u2f.https.html
551                http/wpt/webauthn/public-key-credential-get-success-u2f.https.html
552
553         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
554         (fido::WebCore::constructU2fRegisterCommand):
555         * Modules/webauthn/fido/U2fResponseConverter.cpp:
556         (fido::readU2fSignResponse):
557         (fido::readFromU2fSignResponse): Deleted.
558         * Modules/webauthn/fido/U2fResponseConverter.h:
559
560 2019-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
561
562         [iOS] Dispatch a synthetic mousedown event prior to starting drags
563         https://bugs.webkit.org/show_bug.cgi?id=193229
564         <rdar://problem/46717097>
565
566         Reviewed by Tim Horton.
567
568         Tweaks some drag initiation logic on iOS to actually send a "mousedown" event to the page prior to drag start.
569         This improves drag and drop compatibility with web pages that expect a mousedown to always precede dragging.
570         Additionally, ensure that preventing the "mousedown" event also prevents "dragstart", which matches macOS
571         behavior.
572
573         Test: DragAndDropTests.PreventingMouseDownShouldPreventDragStart
574
575         * page/EventHandler.cpp:
576
577         Make the text drag delay 0 on iOS. This was introduced on iOS when originally bringing up drag and drop, and was
578         made to simply match macOS. However, it doesn't make sense to respect the delay here, since the purpose of this
579         delay is to disambiguate between making a text selection and starting a drag when pressing on text that is
580         already selected; on iOS (including iOSMac), this gesture conflict is already resolved by platform gesture
581         recognizers in the client layer, so there is always no delay between mouse down and drag here.
582
583         * page/ios/EventHandlerIOS.mm:
584
585         Dispatch a mousedown and inspect the value of `m_mouseDownMayStartDrag` when starting a drag on iOS. This brings
586         our behavior closer in line with macOS.
587
588         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
589
590 2019-01-08  Youenn Fablet  <youenn@apple.com>
591
592         service worker fetch handler results in bad referrer
593         https://bugs.webkit.org/show_bug.cgi?id=188248
594         <rdar://problem/47050478>
595
596         Reviewed by Alex Christensen.
597
598         Response sanitization was removing the ReferrerPolicy header from opaque redirect responses.
599         Reduce sanitization of opaque redirect responses to opaque responses and allow Location header.
600         Make sure referrer policy is updated for all load redirections, not only CORS loads.
601
602         Test: http/tests/security/referrer-policy-redirect-link-downgrade.html
603
604         * loader/SubresourceLoader.cpp:
605         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
606         * platform/network/ResourceResponseBase.cpp:
607         (WebCore::isSafeCrossOriginResponseHeader):
608         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
609
610 2019-01-08  Youenn Fablet  <youenn@apple.com>
611
612         IDB storage of Crypto keys does not work in private browsing mode
613         https://bugs.webkit.org/show_bug.cgi?id=193219
614
615         Reviewed by Brady Eidson.
616
617         https://trac.webkit.org/changeset/238677 moved from using a JSGlobalObject to a JSDOMGlobalObject for serialization/deserialization.
618         This does not work for crypto keys as they require not only a JSDOMGlobalObject but either a window or worker global object.
619
620         To fix the issue, revert 238677, and fix it by checking whether the dumping of an ArrayBuffer happens for a JSDOMGlobalObject or a JSGlobalObject.
621         If it is the latter, use JSC routines instead of toJS() which requires a JSDOMGlobalObject.
622
623         Covered by updated test.
624
625         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
626         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
627         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
628         * bindings/js/JSDOMGlobalObject.cpp:
629         * bindings/js/JSDOMGlobalObject.h:
630         * bindings/js/JSDOMWrapper.cpp:
631         (WebCore::JSDOMObject::JSDOMObject):
632         * bindings/js/SerializedScriptValue.cpp:
633         (WebCore::CloneSerializer::dumpArrayBufferView):
634         (WebCore::CloneSerializer::toJSArrayBuffer):
635
636 2019-01-08  Justin Fan  <justin_fan@apple.com>
637
638         [WebGPU] Update createRenderPipeline for WebGPUPipelineLayout
639         https://bugs.webkit.org/show_bug.cgi?id=193247
640
641         Reviewed by Dean Jackson.
642
643         Add WebGPUPipelineLayout to WebGPURenderPipeline via WebGPUPipelineDescriptorBase.
644
645         Test: Updated render-pipelines.html to test new functionality.
646
647         * Modules/webgpu/WebGPUDevice.cpp:
648         (WebCore::WebGPUDevice::createRenderPipeline const): Convert WebGPUPipelineLayout to GPUPipelineLayout.
649         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
650         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl: Add layout field.
651         * Modules/webgpu/WebGPUPipelineLayout.h: 
652         (WebCore::WebGPUPipelineLayout::pipelineLayout): Added. Getter.
653         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Updated from out-of-date version.
654         * platform/graphics/gpu/GPUPipelineLayout.cpp:
655         (WebCore::GPUPipelineLayout::GPUPipelineLayout): Now retains bindGroupLayouts from descriptor.
656         * platform/graphics/gpu/GPUPipelineLayout.h:
657         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Now inherits from GPUPipelineDescriptorBase.
658         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Custom constructor for non-aggregate struct.
659
660 2019-01-08  Chris Dumez  <cdumez@apple.com>
661
662         Prevent cross-site top-level navigations from third-party iframes
663         https://bugs.webkit.org/show_bug.cgi?id=193076
664         <rdar://problem/36074736>
665
666         Reviewed by Alex Christensen.
667
668         Prevent cross-site top-level navigations from third-party iframes if the following conditions are met:
669         1. Its tries to navigate the top-level page cross-site (different eTDL+1)
670         2. The user has never interacted with the third-party iframe or any of its subframes
671
672         This experiment's intent is to block suspicious main-frame navigations by third-party content. The feature
673         is behind a runtime experimental feature flag, on by default.
674
675         Tests: http/tests/security/allow-top-level-navigations-by-third-party-iframes-to-same-origin.html
676                http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-previous-user-activation.html
677                http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-user-activation.html
678                http/tests/security/block-top-level-navigations-by-third-party-iframes.html
679
680         * dom/Document.cpp:
681         (WebCore::printNavigationErrorMessage):
682         (WebCore::Document::canNavigate):
683         (WebCore::Document::canNavigateInternal):
684         (WebCore::Document::isNavigationBlockedByThirdPartyIFrameRedirectBlocking):
685         * dom/Document.h:
686         * dom/UserGestureIndicator.cpp:
687         * page/DOMWindow.cpp:
688         (WebCore::DOMWindow::setLocation):
689         * page/DOMWindow.h:
690         * page/Frame.h:
691         * page/Location.cpp:
692         (WebCore::Location::replace):
693         (WebCore::Location::setLocation):
694         * page/Settings.yaml:
695
696 2019-01-08  Alex Christensen  <achristensen@webkit.org>
697
698         Stop using NetworkStorageSession in WebProcess
699         https://bugs.webkit.org/show_bug.cgi?id=193236
700
701         Reviewed by Don Olmstead.
702
703         No change in behavior.  Some code was only used for ResourceHandle, which isn't used in modern WebKit,
704         and for cookies, which are handled in the NetworkProcess in modern WebKit.
705
706         * loader/CookieJar.cpp:
707         (WebCore::storageSession):
708         * loader/EmptyClients.cpp:
709         * platform/network/NetworkingContext.h:
710         * platform/network/mac/ResourceHandleMac.mm:
711         (WebCore::ResourceHandle::createNSURLConnection):
712         (WebCore::ResourceHandle::start):
713         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
714         (WebCore::ResourceHandle::willSendRequest):
715         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
716         (WebCore::ResourceHandle::receivedCredential):
717
718 2019-01-08  Alex Christensen  <achristensen@webkit.org>
719
720         Unreviewed, rolling out r239727.
721
722         Broke API tests
723
724         Reverted changeset:
725
726         "Stop using NetworkStorageSession in WebProcess"
727         https://bugs.webkit.org/show_bug.cgi?id=193236
728         https://trac.webkit.org/changeset/239727
729
730 2019-01-08  Alex Christensen  <achristensen@webkit.org>
731
732         Stop using NetworkStorageSession in WebProcess
733         https://bugs.webkit.org/show_bug.cgi?id=193236
734
735         Reviewed by Don Olmstead.
736
737         No change in behavior.  Some code was only used for ResourceHandle, which isn't used in modern WebKit,
738         and for cookies, which are handled in the NetworkProcess in modern WebKit.
739
740         * loader/CookieJar.cpp:
741         (WebCore::storageSession):
742         * loader/EmptyClients.cpp:
743         * platform/network/NetworkingContext.h:
744         * platform/network/mac/ResourceHandleMac.mm:
745         (WebCore::ResourceHandle::createNSURLConnection):
746         (WebCore::ResourceHandle::start):
747         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
748         (WebCore::ResourceHandle::willSendRequest):
749         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
750         (WebCore::ResourceHandle::receivedCredential):
751
752 2019-01-08  Chris Dumez  <cdumez@apple.com>
753
754         Regression(PSON-r239182): Blank view when navigating back and forth between google.com and stack overflow
755         https://bugs.webkit.org/show_bug.cgi?id=193224
756         <rdar://problem/47097726>
757
758         Reviewed by Alex Christensen.
759
760         Since r239182, pages get suspended in-place when we suspend the old process after a process-swap on navigation.
761         When we return to a suspended page, we load the current history item again and it normally properly restores
762         the page from PageCache, even though we load the same history item and the current one and even though the
763         page is suspended in-place (i.e. we did not navigate away, which is the usual case for page cache).
764
765         The issue is that if the page URL contains a fragment, FrameLoader::shouldPerformFragmentNavigation() would
766         return true because both the source and destination URLs (which are the same) contains a fragment. To address
767         the issue, update FrameLoader::shouldPerformFragmentNavigation() to return false if the current page is
768         suspended.
769
770         * loader/FrameLoader.cpp:
771         (WebCore::FrameLoader::shouldPerformFragmentNavigation):
772
773 2019-01-08  Alex Christensen  <achristensen@webkit.org>
774
775         Move Windows-specific code from NetworkStorageSessionCFNet.cpp to its own file
776         https://bugs.webkit.org/show_bug.cgi?id=192958
777
778         Reviewed by Yusuke Suzuki.
779
780         This makes it easier to reason about what code is used where.
781
782         * PlatformAppleWin.cmake:
783         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
784         (WebCore::createPrivateStorageSession): Deleted.
785         (WebCore::cookieDomain): Deleted.
786         (WebCore::canonicalCookieTime): Deleted.
787         (WebCore::cookieCreatedTime): Deleted.
788         (WebCore::cookieExpirationTime): Deleted.
789         (WebCore::cookieName): Deleted.
790         (WebCore::cookiePath): Deleted.
791         (WebCore::cookieValue): Deleted.
792         (WebCore::filterCookies): Deleted.
793         (WebCore::copyCookiesForURLWithFirstPartyURL): Deleted.
794         (WebCore::createCookies): Deleted.
795         (WebCore::NetworkStorageSession::setCookiesFromDOM const): Deleted.
796         (WebCore::containsSecureCookies): Deleted.
797         (WebCore::NetworkStorageSession::cookiesForDOM const): Deleted.
798         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): Deleted.
799         (WebCore::NetworkStorageSession::cookiesEnabled const): Deleted.
800         (WebCore::NetworkStorageSession::getRawCookies const): Deleted.
801         (WebCore::NetworkStorageSession::deleteCookie const): Deleted.
802         (WebCore::NetworkStorageSession::getHostnamesWithCookies): Deleted.
803         (WebCore::NetworkStorageSession::deleteAllCookies): Deleted.
804         (WebCore::NetworkStorageSession::deleteCookiesForHostnames): Deleted.
805         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince): Deleted.
806         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: Added.
807         (WebCore::createPrivateStorageSession):
808         (WebCore::NetworkStorageSession::setCookies):
809         (WebCore::cookieDomain):
810         (WebCore::canonicalCookieTime):
811         (WebCore::cookieCreatedTime):
812         (WebCore::cookieExpirationTime):
813         (WebCore::cookieName):
814         (WebCore::cookiePath):
815         (WebCore::cookieValue):
816         (WebCore::filterCookies):
817         (WebCore::copyCookiesForURLWithFirstPartyURL):
818         (WebCore::createCookies):
819         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
820         (WebCore::containsSecureCookies):
821         (WebCore::NetworkStorageSession::cookiesForDOM const):
822         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
823         (WebCore::NetworkStorageSession::cookiesEnabled const):
824         (WebCore::NetworkStorageSession::getRawCookies const):
825         (WebCore::NetworkStorageSession::deleteCookie const):
826         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
827         (WebCore::NetworkStorageSession::deleteAllCookies):
828         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
829         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
830
831 2018-12-19  Antoine Quint  <graouts@apple.com>
832
833         [Web Animations] Compute animation effect timing properties in batch
834         https://bugs.webkit.org/show_bug.cgi?id=192850
835
836         Reviewed by Dean Jackson.
837
838         We remove a host of functions from AnimationEffect that would allow the computation of various timing properties
839         defined by the Web Animations specification: phase, progress, current iteration, etc. Indeed, a lot of these functions
840         would call each other in a chain, and we would re-compute a lot of the earlier properties in those chains several times
841         when doing something like querying the animation progress. Additionally, some functions, such as WebAnimation::computeRelevance()
842         and WebAnimation::timeToNextTick() would yield the computation of several such properties numerous times. All of those
843         functions are called during each animation frame and are ripe for optimizations.
844
845         We now compute all timing properties across two functions:
846         
847         1. the new AnimationEffect::getBasicTiming() which computes the local time, end time, active duration, active time and phase,
848         2. the existing AnimationEffect::getComputedTiming() which now also exposes the phase and simple iteration progress.
849
850         To support this we introduce a new BasicEffectTiming struct to contain the values computed in AnimationEffect::getBasicTiming()
851         and spun the AnimationEffect::Phase struct as AnimationEffectPhase so that it may be used across BasicEffectTiming and
852         ComputedEffectTiming.
853
854         No new test since there is no user-observable change.
855
856         * WebCore.xcodeproj/project.pbxproj:
857         * animation/AnimationEffect.cpp:
858         (WebCore::AnimationEffect::getTiming const):
859         (WebCore::AnimationEffect::getBasicTiming const):
860         (WebCore::AnimationEffect::getComputedTiming const):
861         (WebCore::AnimationEffect::localTime const): Deleted.
862         (WebCore::AnimationEffect::phase const): Deleted.
863         (WebCore::AnimationEffect::activeTime const): Deleted.
864         (WebCore::AnimationEffect::overallProgress const): Deleted.
865         (WebCore::AnimationEffect::simpleIterationProgress const): Deleted.
866         (WebCore::AnimationEffect::currentIteration const): Deleted.
867         (WebCore::AnimationEffect::currentDirection const): Deleted.
868         (WebCore::AnimationEffect::directedProgress const): Deleted.
869         (WebCore::AnimationEffect::transformedProgress const): Deleted.
870         (WebCore::AnimationEffect::iterationProgress const): Deleted.
871         (WebCore::AnimationEffect::getTiming): Deleted.
872         (WebCore::AnimationEffect::getComputedTiming): Deleted.
873         (WebCore::AnimationEffect::endTime const): Deleted.
874         (WebCore::AnimationEffect::activeDuration const): Deleted.
875         * animation/AnimationEffect.h:
876         * animation/AnimationEffectPhase.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
877         * animation/AnimationTimeline.cpp:
878         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
879         * animation/AnimationTimeline.h:
880         * animation/BasicEffectTiming.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
881         * animation/ComputedEffectTiming.h:
882         * animation/DeclarativeAnimation.cpp:
883         (WebCore::DeclarativeAnimation::cancel):
884         (WebCore::DeclarativeAnimation::phaseWithoutEffect const):
885         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
886         * animation/DeclarativeAnimation.h:
887         * animation/KeyframeEffect.cpp:
888         (WebCore::KeyframeEffect::apply):
889         (WebCore::KeyframeEffect::getAnimatedStyle):
890         * animation/WebAnimation.cpp:
891         (WebCore::WebAnimation::effectEndTime const):
892         (WebCore::WebAnimation::computeRelevance):
893         (WebCore::WebAnimation::timeToNextTick const):
894
895 2019-01-07  Youenn Fablet  <youenn@apple.com>
896
897         Crash in SWServer::Connection::resolveRegistrationReadyRequests
898         https://bugs.webkit.org/show_bug.cgi?id=193217
899
900         Reviewed by Chris Dumez.
901
902         As can be seen from the traces, SWServer might clear its connections HashMap in its destructor.
903         This might then trigger calling SWServer::resolveRegistrationReadyRequests.
904         This method is iterating on the connections HashMap which is being cleared.
905         To remove this problem, move the HashMap in a temporary variable and clear the temporary variable.
906
907         * workers/service/server/SWServer.cpp:
908         (WebCore::SWServer::~SWServer):
909
910 2019-01-07  Jer Noble  <jer.noble@apple.com>
911
912         REGRESSION (r239519): ASSERTION FAILED: !m_adoptionIsRequired in com.apple.WebCore: void WTF::refIfNotNull<WebCore::CDMSessionMediaSourceAVFObjC> + 53
913         https://bugs.webkit.org/show_bug.cgi?id=193211
914         <rdar://problem/46937412>
915
916         Reviewed by Eric Carlson.
917
918         Make CDMSessionMediaSourceAVFObjC a CanMakeWeakPtr rather than RefCounted, as CDMSessions are stored in
919         std::unique_ptrs, and not in Ref or RefPtr.
920
921         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
922         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
923         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
924         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
925
926 2019-01-07  David Kilzer  <ddkilzer@apple.com>
927
928         Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
929         <https://webkit.org/b/193056>
930
931         Reviewed by Alex Christensen.
932
933         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
934         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
935         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
936         * platform/network/cf/AuthenticationChallenge.h:
937         - Remove '*' from RetainPtr<> type.
938
939         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
940         (WebCore::cookiesForURL):
941         - Once retainPtr() was changed to return RetainPtr<NSArray>
942           instead of RetainPtr<NSArray *> here, that forced the type of
943           `cookiesPtr` to change as well since
944           Optional<RetainPtr<NSArray>> is not assignable to
945           Optional<RetainPtr<NSArray *>> without further template
946           specialization, which didn't seem useful since
947           Optional<RetainPtr<>> variable types are rarely used.
948
949 2019-01-07  Devin Rousso  <drousso@apple.com>
950
951         Web Inspector: extend XHR breakpoints to work with fetch
952         https://bugs.webkit.org/show_bug.cgi?id=185843
953         <rdar://problem/40431027>
954
955         Reviewed by Matt Baker.
956
957         Test: inspector/dom-debugger/url-breakpoints.html
958
959         * Modules/fetch/FetchResponse.cpp:
960         (WebCore::FetchResponse::fetch):
961
962         * inspector/InspectorInstrumentation.h:
963         (WebCore::InspectorInstrumentation::willFetch): Added.
964         * inspector/InspectorInstrumentation.cpp:
965         (WebCore::InspectorInstrumentation::willFetchImpl): Added.
966
967         * inspector/agents/InspectorDOMDebuggerAgent.h:
968         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
969         (WebCore::InspectorDOMDebuggerAgent::disable):
970         (WebCore::InspectorDOMDebuggerAgent::discardBindings):
971         (WebCore::InspectorDOMDebuggerAgent::setURLBreakpoint): Added.
972         (WebCore::InspectorDOMDebuggerAgent::removeURLBreakpoint): Added.
973         (WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded): Added.
974         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
975         (WebCore::InspectorDOMDebuggerAgent::willFetch): Added.
976         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Deleted.
977         (WebCore::InspectorDOMDebuggerAgent::removeXHRBreakpoint): Deleted.
978
979 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
980
981         Cleanup AudioTrackPrivateMediaStreamCocoa
982         https://bugs.webkit.org/show_bug.cgi?id=193208
983         <rdar://problem/42225870>
984
985         Reviewed by Youenn Fablet.
986
987         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
988         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and
989         output format descriptions after stopping the audio unit.
990
991 2019-01-07  Devin Rousso  <drousso@apple.com>
992
993         Web Inspector: Network: show secure connection details per-request
994         https://bugs.webkit.org/show_bug.cgi?id=191539
995         <rdar://problem/45979891>
996
997         Reviewed by Joseph Pecoraro.
998
999         Test: http/tests/inspector/network/resource-security-connection.html
1000
1001         * platform/network/NetworkLoadMetrics.h:
1002         (WebCore::NetworkLoadMetrics:isolatedCopy):
1003         (WebCore::NetworkLoadMetrics:clearNonTimingData):
1004         (WebCore::NetworkLoadMetrics:operator==):
1005         (WebCore::NetworkLoadMetrics:encode):
1006         (WebCore::NetworkLoadMetrics:decode):
1007
1008         * inspector/agents/InspectorNetworkAgent.cpp:
1009         (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
1010
1011 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
1012
1013         Deactivate audio session whenever possible
1014         https://bugs.webkit.org/show_bug.cgi?id=193188
1015         <rdar://problem/42678977>
1016
1017         Reviewed by Jer Noble.
1018
1019         Test: media/deactivate-audio-session.html
1020
1021         * platform/audio/AudioSession.cpp:
1022         (WebCore::AudioSession::tryToSetActive):
1023         (WebCore::AudioSession::tryToSetActiveInternal):
1024         * platform/audio/AudioSession.h:
1025         (WebCore::AudioSession::isActive const):
1026
1027         * platform/audio/PlatformMediaSessionManager.cpp:
1028         (WebCore::PlatformMediaSessionManager::removeSession):
1029         (WebCore::deactivateAudioSession):
1030         (WebCore::PlatformMediaSessionManager::shouldDeactivateAudioSession):
1031         (WebCore::PlatformMediaSessionManager::setShouldDeactivateAudioSession):
1032         * platform/audio/PlatformMediaSessionManager.h:
1033
1034         * platform/audio/ios/AudioSessionIOS.mm:
1035         (WebCore::AudioSession::tryToSetActiveInternal):
1036         (WebCore::AudioSession::tryToSetActive): Deleted.
1037
1038         * platform/audio/mac/AudioSessionMac.cpp:
1039         (WebCore::AudioSession::tryToSetActiveInternal):
1040         (WebCore::AudioSession::tryToSetActive): Deleted.
1041
1042         * testing/Internals.cpp:
1043         (WebCore::Internals::audioSessionActive const):
1044         * testing/Internals.h:
1045         * testing/Internals.idl:
1046
1047 2019-01-07  David Kilzer  <ddkilzer@apple.com>
1048
1049         PlatformECKey should use a std::unique_ptr
1050         <https://webkit.org/b/193170>
1051
1052         Reviewed by Brent Fulgham.
1053
1054         Broadly:
1055         - Switch from using raw pointers to using std::unique_ptr<> to
1056           hold PlatformECKey.
1057         - Introduce PlatformECKeyContainer type to handle different
1058           std::unique_ptr<> types on each platform.
1059         - Get rid of custom CryptoKeyEC destructors since the
1060           std::unique_ptr<> handles that with a Deleter.
1061         - Initialize stack variables to nullptr.
1062
1063         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1064         (WebCore::CryptoKeyEC::keySizeInBits const):
1065         (WebCore::CryptoKeyEC::platformGeneratePair):
1066         (WebCore::CryptoKeyEC::platformImportRaw):
1067         (WebCore::CryptoKeyEC::platformImportJWKPublic):
1068         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
1069         (WebCore::CryptoKeyEC::platformImportSpki):
1070         (WebCore::CryptoKeyEC::platformImportPkcs8):
1071         (WebCore::CryptoKeyEC::platformExportRaw const):
1072         (WebCore::CryptoKeyEC::platformAddFieldElements const):
1073         (WebCore::CryptoKeyEC::platformExportSpki const):
1074         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
1075         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
1076         * crypto/keys/CryptoKeyEC.cpp:
1077         (WebCore::CryptoKeyEC::CryptoKeyEC):
1078         * crypto/keys/CryptoKeyEC.h:
1079         (WebCore::CCECCryptorRefDeleter::operator() const):
1080         * crypto/mac/CryptoKeyECMac.cpp:
1081         (WebCore::CryptoKeyEC::keySizeInBits const):
1082         (WebCore::CryptoKeyEC::platformGeneratePair):
1083         (WebCore::CryptoKeyEC::platformImportRaw):
1084         (WebCore::CryptoKeyEC::platformExportRaw const):
1085         (WebCore::CryptoKeyEC::platformImportJWKPublic):
1086         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
1087         (WebCore::CryptoKeyEC::platformAddFieldElements const):
1088         (WebCore::CryptoKeyEC::platformImportSpki):
1089         (WebCore::CryptoKeyEC::platformExportSpki const):
1090         (WebCore::CryptoKeyEC::platformImportPkcs8):
1091         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
1092         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
1093
1094 2019-01-07  Antti Koivisto  <antti@apple.com>
1095
1096         UI process side scrollbars for UI side compositing on Mac
1097         https://bugs.webkit.org/show_bug.cgi?id=193106
1098
1099         Reviewed by Tim Horton.
1100
1101         * page/FrameView.cpp:
1102         (WebCore::FrameView::paintScrollCorner):
1103         * page/scrolling/AsyncScrollingCoordinator.cpp:
1104         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1105
1106         Pass scrollbar host layers and the dark appearance bit to the scrolling tree.
1107
1108         * page/scrolling/ScrollingCoordinator.cpp:
1109         (WebCore::ScrollingCoordinator::verticalScrollbarLayerForFrameView):
1110         (WebCore::ScrollingCoordinator::horizontalScrollbarLayerForFrameView):
1111         * page/scrolling/ScrollingCoordinator.h:
1112         (WebCore::ScrollableAreaParameters::ScrollableAreaParameters):
1113         (WebCore::ScrollableAreaParameters::operator== const):
1114         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1115         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1116         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarLayers):
1117         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1118         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1119         * page/scrolling/ScrollingTreeScrollingNode.h:
1120         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const):
1121         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const):
1122         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const):
1123         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const):
1124         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1125         * platform/ScrollableArea.cpp:
1126         (WebCore::ScrollableArea::useDarkAppearanceForScrollbars const):
1127
1128         Factor into a function as this is used in several places.
1129
1130         * platform/ScrollableArea.h:
1131         * platform/mac/NSScrollerImpDetails.h:
1132         * platform/mac/ScrollAnimatorMac.mm:
1133         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
1134         * platform/mac/ScrollbarThemeMac.h:
1135
1136 2019-01-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1137
1138         Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
1139         https://bugs.webkit.org/show_bug.cgi?id=193180
1140         <rdar://problem/45971041>
1141
1142         Reviewed by Tim Horton.
1143
1144         Adjust a method on RenderObject to additionally detect when the RenderObject is inside of an `overflow: hidden`
1145         container that is also empty. See WebKit ChangeLog for more details.
1146
1147         Test:   editing/selection/ios/hide-selection-in-empty-overflow-hidden-container.html
1148                 editing/selection/ios/show-selection-in-empty-overflow-hidden-document.html
1149
1150         * rendering/RenderObject.cpp:
1151         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
1152         (WebCore::RenderObject::isTransparentRespectingParentFrames const): Deleted.
1153         * rendering/RenderObject.h:
1154
1155 2019-01-07  Zalan Bujtas  <zalan@apple.com>
1156
1157         [LFC][BFC] Margin collapsing should not be limited to in-flow non-replaced boxes.
1158         https://bugs.webkit.org/show_bug.cgi?id=193183
1159
1160         Reviewed by Antti Koivisto.
1161
1162         * layout/FormattingContext.cpp:
1163         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1164         * layout/FormattingContextGeometry.cpp:
1165         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1166         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1167         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1168         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1169         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1170         * layout/LayoutUnits.h:
1171         * layout/blockformatting/BlockFormattingContext.cpp:
1172         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1173         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1174         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1175         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1176         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1177         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1178         * layout/inlineformatting/InlineFormattingContext.cpp:
1179         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
1180
1181 2019-01-07  Zalan Bujtas  <zalan@apple.com>
1182
1183         [LFC][BFC] Move MarginCollapse from BlockFormattingContext::Geometry to BlockFormattingContext
1184         https://bugs.webkit.org/show_bug.cgi?id=193181
1185
1186         Reviewed by Antti Koivisto.
1187
1188         This is in preparation to share margin collapsing across all boxes in block formatting context.
1189
1190         * layout/blockformatting/BlockFormattingContext.h:
1191         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1192         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1193         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1194         * layout/blockformatting/BlockMarginCollapse.cpp:
1195         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore):
1196         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter):
1197         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore):
1198         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter):
1199         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild):
1200         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild):
1201         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
1202         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
1203         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
1204         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
1205         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
1206         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
1207         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling):
1208         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
1209         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore):
1210         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter):
1211         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
1212         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
1213         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): Deleted.
1214         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): Deleted.
1215         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
1216         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
1217         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): Deleted.
1218         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): Deleted.
1219         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): Deleted.
1220         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): Deleted.
1221         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): Deleted.
1222         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
1223         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
1224         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): Deleted.
1225         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): Deleted.
1226         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): Deleted.
1227
1228 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
1229
1230         [WPE] Use Widget bounds for PlatformScreen rectangle information
1231         https://bugs.webkit.org/show_bug.cgi?id=193190
1232
1233         Reviewed by Philippe Normand.
1234
1235         Provide a better screen area estimate in screenRect() and
1236         screenAvailableRect() return values than the current 1240x640 value by
1237         using the Widget's bounds rectangle.
1238
1239         This approach is only factually correct when the Widget-associated view
1240         is displayed in fullscreen, but it provides a better estimate even when
1241         displayed in any other case as well. WPE doesn't provide specific API
1242         that could enable the embedding environment to provide this information.
1243
1244         * platform/wpe/PlatformScreenWPE.cpp:
1245         (WebCore::screenRect): Return bounds of the Widget object.
1246         (WebCore::screenAvailableRect): Relay the call to screenRect().
1247
1248 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
1249
1250         Make Gradient::gradientSpaceTransform(), Pattern::patternSpaceTransform() methods const
1251         https://bugs.webkit.org/show_bug.cgi?id=193189
1252
1253         Reviewed by Philippe Normand.
1254
1255         The transform getter methods on the Gradient and Pattern classes both
1256         return const references to the transform objects, and don't modify any
1257         internal state. They should be marked const accordingly, allowing
1258         invocations of these two methods through const references to Gradient
1259         and Pattern objects.
1260
1261         * platform/graphics/Gradient.h:
1262         (WebCore::Gradient::gradientSpaceTransform): Now const.
1263         * platform/graphics/Pattern.h:
1264         (WebCore::Pattern::patternSpaceTransform): Now const.
1265
1266 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
1267
1268         REGRESSION(r239636): ImageDecoder::setEncodedDataStatusChangeCallback() can be called on a null decoder
1269         https://bugs.webkit.org/show_bug.cgi?id=193187
1270
1271         Reviewed by Philippe Normand.
1272
1273         * platform/graphics/ImageSource.cpp:
1274         (WebCore::ImageSource::ensureDecoderAvailable): Bail before calling the
1275         setEncodedDataStatusChangeCallback() method when the returned
1276         ImageDecoder object is null.
1277
1278 2019-01-06  Zan Dobersek  <zdobersek@igalia.com>
1279
1280         [Nicosia] Take over CoordinatedGraphics-named implementation of async scrolling classes
1281         https://bugs.webkit.org/show_bug.cgi?id=193133
1282
1283         Reviewed by Michael Catanzaro.
1284
1285         Move the CoordinatedGraphics-specific files under
1286         page/scrolling/coordinatedgraphics/ to page/scrolling/nicosia/, along
1287         with renaming the files and classes accordingly. Implementation will
1288         only depend on the Nicosia-specific layer structure and is not specific
1289         to the CoordinatedGraphics system.
1290
1291         * PlatformPlayStation.cmake:
1292         * SourcesGTK.txt:
1293         * SourcesWPE.txt:
1294         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp.
1295         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h.
1296         * page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp.
1297         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp.
1298         * page/scrolling/nicosia/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h.
1299         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp.
1300         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h.
1301         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp.
1302         * page/scrolling/nicosia/ScrollingTreeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h.
1303         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp.
1304         * page/scrolling/nicosia/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h.
1305         * platform/TextureMapper.cmake:
1306
1307 2019-01-06  Jiewen Tan  <jiewen_tan@apple.com>
1308
1309         [WebAuthN] Import U2F command/response converters from Chromium
1310         https://bugs.webkit.org/show_bug.cgi?id=193150
1311         <rdar://problem/47054028>
1312
1313         Reviewed by Brent Fulgham.
1314
1315         This patch imports Chromium's U2F command/response converters:
1316         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
1317         1. It directly imports the following files and suit them to WebKit's coding style:
1318         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.cc?l=1&rcl=db624110317d01efa78cd32e7be1524190e1beb0
1319         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.h?rcl=db624110317d01efa78cd32e7be1524190e1beb0
1320         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor_unittest.cc?rcl=db624110317d01efa78cd32e7be1524190e1beb0
1321         2. It gathers the following methods into U2fResponseConverter:
1322         AuthenticatorMakeCredentialResponse::CreateFromU2fRegisterResponse()
1323         AuthenticatorGetAssertionResponse::CreateFromU2fSignResponse()
1324         3. It also updates FidoConstants.h, FidoTestData.h and CtapResponseTest.cpp accordingly.
1325
1326         Besides importing stuff from Chroimum, it also gathers a bunch of constants and helper functions into WebAuthenticationConstants.h
1327         and WebAuthenticationUtils.h. It also fixes Bug 183534: 2) and 7).
1328
1329         Covered by API tests.
1330
1331         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1332         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJsonHash):
1333         * Modules/webauthn/WebAuthenticationConstants.h: Copied from Source/WebCore/Modules/webauthn/COSEConstants.h.
1334         * Modules/webauthn/WebAuthenticationUtils.cpp: Added.
1335         (WebCore::convertBytesToVector):
1336         (WebCore::produceRpIdHash):
1337         (WebCore::encodeES256PublicKeyAsCBOR):
1338         (WebCore::buildAttestedCredentialData):
1339         (WebCore::buildAuthData):
1340         (WebCore::buildAttestationObject):
1341         * Modules/webauthn/WebAuthenticationUtils.h: Renamed from Source/WebCore/Modules/webauthn/COSEConstants.h.
1342         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
1343         (fido::getCredentialId):
1344         (fido::readCTAPGetInfoResponse):
1345         * Modules/webauthn/fido/FidoConstants.h:
1346         * Modules/webauthn/fido/U2fCommandConstructor.cpp: Added.
1347         (fido::WebCore::constructU2fRegisterCommand):
1348         (fido::WebCore::constructU2fSignCommand):
1349         (fido::isConvertibleToU2fRegisterCommand):
1350         (fido::isConvertibleToU2fSignCommand):
1351         (fido::convertToU2fRegisterCommand):
1352         (fido::convertToU2fCheckOnlySignCommand):
1353         (fido::convertToU2fSignCommand):
1354         (fido::constructBogusU2fRegistrationCommand):
1355         * Modules/webauthn/fido/U2fCommandConstructor.h: Added.
1356         * Modules/webauthn/fido/U2fResponseConverter.cpp: Added.
1357         (fido::WebCore::extractECPublicKeyFromU2fRegistrationResponse):
1358         (fido::WebCore::extractCredentialIdFromU2fRegistrationResponse):
1359         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
1360         (fido::WebCore::parseX509Length):
1361         (fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse):
1362         (fido::readU2fRegisterResponse):
1363         (fido::readFromU2fSignResponse):
1364         * Modules/webauthn/fido/U2fResponseConverter.h: Added.
1365         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1366         * Sources.txt:
1367         * WebCore.xcodeproj/project.pbxproj:
1368
1369 2019-01-06  David Kilzer  <ddkilzer@apple.com>
1370
1371         Leak of WTF::Function objects in WebCore::CryptoKeyRSA::generatePair() (64-80 bytes each) in com.apple.WebKit.WebContent running WebKit layout tests
1372         <https://webkit.org/b/193177>
1373         <rdar://problem/47072196>
1374
1375         Reviewed by Saam Barati.
1376
1377         * crypto/mac/CryptoKeyRSAMac.cpp:
1378         (WebCore::CryptoKeyRSA::generatePair): Fix the leak by changing
1379         raw pointers to heap-allocated __block variables to hold the
1380         WTF::Function objects until they are consumed within the block
1381         passed to dispatch_async().  The __block variables act like
1382         captured variables in a C++ lambda and have the same lifetime as
1383         the block that they are captured in.  Note that we would have to
1384         convert the source file from C++ to Objective-C++ to use a C++
1385         lambda functor with dispatch_async(), which creates its own
1386         issue because the comipiler requires a copy constructor to
1387         convert the C++ lambda to a block functor, but the copy
1388         constructor for the C++ lambda is implicitly deleted because the
1389         WTF::Function copy constructor is explicitly deleted.  Whew!
1390
1391 2019-01-06  Pablo Saavedra  <psaavedra@igalia.com>
1392
1393         [WPE][GTK] Building with ENABLE_VIDEO=OFF fails trying to use Document MediaPlayback functions.
1394         https://bugs.webkit.org/show_bug.cgi?id=193174
1395
1396         Reviewed by Michael Catanzaro.
1397
1398         * page/Page.cpp:
1399         (WebCore::Page::stopAllMediaPlayback):
1400         (WebCore::Page::suspendAllMediaPlayback):
1401         (WebCore::Page::resumeAllMediaPlayback):
1402
1403 2019-01-05  David Kilzer  <ddkilzer@apple.com>
1404
1405         Leak of two CCRSACryptorRef (4.0 Kbytes/1 page each) in com.apple.WebKit.WebContent running WebKit layout tests
1406         <https://webkit.org/b/193154>
1407         <rdar://problem/47052993>
1408
1409         Reviewed by Brent Fulgham.
1410
1411         Broadly:
1412         - Fix leaks by switching from using raw pointers to using
1413           std::unique_ptr<>.
1414         - Introduce PlatformRSAKeyContainer type to handle different
1415           std::unique_ptr<> on each platform.
1416         - Get rid of custom CryptoKeyRSA destructors since the
1417           std::unique_ptr<> handles that with a Deleter.
1418         - Initialize stack variables to nullptr.
1419
1420         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1421         (WebCore::CryptoKeyRSA::create):
1422         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
1423         (WebCore::CryptoKeyRSA::keySizeInBits const):
1424         (WebCore::CryptoKeyRSA::generatePair):
1425         (WebCore::CryptoKeyRSA::importSpki):
1426         (WebCore::CryptoKeyRSA::importPkcs8):
1427         (WebCore::CryptoKeyRSA::exportSpki const):
1428         (WebCore::CryptoKeyRSA::exportPkcs8 const):
1429         (WebCore::CryptoKeyRSA::algorithm const):
1430         (WebCore::CryptoKeyRSA::exportData const):
1431         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
1432         * crypto/keys/CryptoKeyRSA.h:
1433         (WebCore::CCRSACryptorRefDeleter::operator() const):
1434         * crypto/mac/CryptoKeyRSAMac.cpp:
1435         (WebCore::getPublicKeyComponents):
1436         (WebCore::getPrivateKeyComponents):
1437         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
1438         (WebCore::CryptoKeyRSA::create):
1439         (WebCore::CryptoKeyRSA::exportData const):
1440         (WebCore::CryptoKeyRSA::generatePair):
1441         (WebCore::CryptoKeyRSA::importSpki):
1442         (WebCore::CryptoKeyRSA::importPkcs8):
1443         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
1444
1445 2019-01-05  Zalan Bujtas  <zalan@apple.com>
1446
1447         Incorrect clipping across compositing boundary.
1448         https://bugs.webkit.org/show_bug.cgi?id=193172
1449         <rdar://problem/44693008>
1450
1451         Reviewed by Simon Fraser.
1452
1453         Use temporary cliprect type when crossing compositing boundary to prevent cliprect caching.
1454
1455         The issue here is that RenderLayer::backgroundClipRect() could cross compositing boundary by calling parentClipRects() which triggers
1456         clip rect update using the wrong painting root. This happens when the layer hierarchy and the compositing context do not match.
1457         For clip rect computation, we need to climb up on the layer hierarchy (calling parent layer's cliprect functions)
1458         but we also need to make sure that the computed cliprects on any given layer are cached only when the painting root is correct.
1459         It ensures that when we paint a layer (with the painting root as entry point), the cached cliprects are always based on its onw painting root. 
1460
1461         Test: compositing/clipping/cached-cliprect-with-compositing-boundary.html
1462
1463         * rendering/RenderLayer.cpp:
1464         (WebCore::RenderLayer::calculateClipRects const):
1465
1466 2019-01-05  Youenn Fablet  <youenn@apple.com>
1467
1468         Service Worker fetch should obey its referrer policy
1469         https://bugs.webkit.org/show_bug.cgi?id=193152
1470
1471         Reviewed by Chris Dumez.
1472
1473         Pass referrer policy retrieved when fetching the service worker script to the SWServer.
1474         The SWServer then stores it persistently and sends it to the manager creating service workers.
1475         This manager will then set the referrer policy on the dummy Document of the corresponding service worker.
1476
1477         Covered by rebased test.
1478
1479         * workers/WorkerScriptLoader.cpp:
1480         (WebCore::WorkerScriptLoader::didReceiveResponse):
1481         * workers/WorkerScriptLoader.h:
1482         (WebCore::WorkerScriptLoader::referrerPolicy const):
1483         * workers/service/SWClientConnection.cpp:
1484         (WebCore::SWClientConnection::failedFetchingScript):
1485         * workers/service/ServiceWorkerContainer.cpp:
1486         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
1487         * workers/service/ServiceWorkerContainer.h:
1488         * workers/service/ServiceWorkerContextData.cpp:
1489         (WebCore::ServiceWorkerContextData::isolatedCopy const):
1490         * workers/service/ServiceWorkerContextData.h:
1491         (WebCore::ServiceWorkerContextData::encode const):
1492         (WebCore::ServiceWorkerContextData::decode):
1493         * workers/service/ServiceWorkerFetchResult.h:
1494         (WebCore::ServiceWorkerFetchResult::encode const):
1495         (WebCore::ServiceWorkerFetchResult::decode):
1496         * workers/service/ServiceWorkerJob.cpp:
1497         (WebCore::ServiceWorkerJob::notifyFinished):
1498         * workers/service/ServiceWorkerJobClient.h:
1499         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1500         (WebCore::createPageForServiceWorker):
1501         * workers/service/server/RegistrationDatabase.cpp:
1502         (WebCore::recordsTableSchema):
1503         (WebCore::RegistrationDatabase::doPushChanges):
1504         (WebCore::RegistrationDatabase::importRecords):
1505         * workers/service/server/SWServer.cpp:
1506         (WebCore::SWServer::addRegistrationFromStore):
1507         (WebCore::SWServer::updateWorker):
1508         (WebCore::SWServer::installContextData):
1509         * workers/service/server/SWServer.h:
1510         * workers/service/server/SWServerJobQueue.cpp:
1511         (WebCore::SWServerJobQueue::scriptFetchFinished):
1512         * workers/service/server/SWServerWorker.cpp:
1513         (WebCore::SWServerWorker::SWServerWorker):
1514         (WebCore::SWServerWorker::contextData const):
1515         * workers/service/server/SWServerWorker.h:
1516
1517 2019-01-04  Simon Fraser  <simon.fraser@apple.com>
1518
1519         Factor legacy WK1 code for fixed and scrolling layers into their own helper class
1520         https://bugs.webkit.org/show_bug.cgi?id=193165
1521
1522         Reviewed by Frédéric Wang.
1523
1524         RenderLayerCompositor has some code to handle registration of viewport-constrained
1525         and scrolling layers which is specific to iOS WK1. To reduce pollution, move this
1526         into its own helper class called LegacyWebKitScrollingLayerCoordinator, which is only
1527         allocated for iOS WK1.
1528         
1529         iOS WK1 never has a ScrollingCoordinator, so rather than the check for scrollingCoordinator(),
1530         we know that we only made a LegacyWebKitScrollingLayerCoordinator when there's a platform widget
1531         (i.e. WK1).
1532         
1533         * page/ChromeClient.h:
1534         * rendering/RenderLayerCompositor.cpp:
1535         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
1536         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
1537         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
1538         (WebCore::RenderLayerCompositor::setIsInWindow):
1539         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): No longer check the page cache state; now we
1540         destroy the render tree of pages in the page cache, so we should never hit this code path.
1541         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
1542         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
1543         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllViewportConstrainedLayers):
1544         (WebCore::scrollbarHasDisplayNone):
1545         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
1546         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllScrollingLayers):
1547         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate):
1548         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
1549         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
1550         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
1551         (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer):
1552         (WebCore::updateScrollingLayerWithClient): Deleted.
1553         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): Deleted.
1554         (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers): Deleted.
1555         (WebCore::RenderLayerCompositor::registerAllScrollingLayers): Deleted.
1556         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): Deleted.
1557         * rendering/RenderLayerCompositor.h:
1558         (WebCore::LegacyWebKitScrollingLayerCoordinator::LegacyWebKitScrollingLayerCoordinator):
1559         * workers/service/ServiceWorkerContainer.cpp:
1560         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
1561
1562 2019-01-05  Zalan Bujtas  <zalan@apple.com>
1563
1564         [LFC] VerticalMargin should only have the used values.
1565         https://bugs.webkit.org/show_bug.cgi?id=193168
1566
1567         Reviewed by Antti Koivisto.
1568
1569         Split VerticalMargin into ComputedVerticalMargin and UsedVerticalMargin.
1570         ComputedVerticalMargin holds the computed (optional) values while UsedVerticalMargin holds both the
1571         collapsed (optional) and the non-collapsed values.
1572
1573         * layout/FormattingContext.cpp:
1574         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1575         * layout/FormattingContext.h:
1576         * layout/FormattingContextGeometry.cpp:
1577         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1578         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1579         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1580         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1581         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1582         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
1583         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): Deleted.
1584         * layout/FormattingContextQuirks.cpp:
1585         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1586         * layout/LayoutUnits.h:
1587         * layout/MarginTypes.h:
1588         (WebCore::Layout::UsedVerticalMargin::before const):
1589         (WebCore::Layout::UsedVerticalMargin::after const):
1590         (WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const):
1591         (WebCore::Layout::UsedVerticalMargin::collapsedValues const):
1592         (WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const):
1593         (WebCore::Layout::UsedVerticalMargin::setCollapsedValues):
1594         (WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin):
1595         (WebCore::Layout::VerticalMargin::nonCollapsedValues const): Deleted.
1596         (WebCore::Layout::VerticalMargin::collapsedValues const): Deleted.
1597         (WebCore::Layout::VerticalMargin::setCollapsedValues): Deleted.
1598         (WebCore::Layout::VerticalMargin::VerticalMargin): Deleted.
1599         (WebCore::Layout::VerticalMargin::usedValues const): Deleted.
1600         * layout/blockformatting/BlockFormattingContext.cpp:
1601         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1602         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1603         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1604         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1605         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1606         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1607         * layout/blockformatting/BlockMarginCollapse.cpp:
1608         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
1609         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
1610         * layout/displaytree/DisplayBox.h:
1611         (WebCore::Display::Box::setVerticalMargin):
1612         (WebCore::Display::Box::verticalMargin const):
1613         (WebCore::Display::Box::marginBefore const):
1614         (WebCore::Display::Box::marginAfter const):
1615         * layout/floats/FloatingContext.cpp:
1616         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1617         * layout/inlineformatting/InlineFormattingContext.cpp:
1618         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
1619
1620 2019-01-04  Daniel Bates  <dabates@apple.com>
1621
1622         REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com
1623         https://bugs.webkit.org/show_bug.cgi?id=192996
1624         <rdar://problem/46573552>
1625
1626         Reviewed by Simon Fraser.
1627
1628         Only scroll a text field if its inner text size changes and it is the currently active and
1629         focused element on the page.
1630
1631         Test: fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html
1632
1633         * rendering/RenderTextControlSingleLine.cpp:
1634         (WebCore::RenderTextControlSingleLine::layout):
1635
1636 2019-01-04  Alex Christensen  <achristensen@webkit.org>
1637
1638         Progress towards fixing Mac CMake build
1639         https://bugs.webkit.org/show_bug.cgi?id=193105
1640
1641         Reviewed by Don Olmstead.
1642
1643         * PlatformMac.cmake:
1644         * Sources.txt:
1645         * SourcesCocoa.txt:
1646         * WebCore.xcodeproj/project.pbxproj:
1647         * platform/graphics/gpu/GPURenderPassEncoder.h:
1648
1649 2019-01-04  Zalan Bujtas  <zalan@apple.com>
1650
1651         [iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker()
1652         https://bugs.webkit.org/show_bug.cgi?id=189608
1653         <rdar://problem/44473299>
1654
1655         Reviewed by Simon Fraser.
1656
1657         When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well.
1658
1659         Covered by fast/frames/invalid-frameset.html.
1660
1661         * rendering/RenderFrameSet.cpp:
1662         (WebCore::clearSiblingSubtrees):
1663         (WebCore::RenderFrameSet::positionFrames):
1664         (WebCore::RenderFrameSet::positionFramesWithFlattening):
1665
1666 2019-01-04  Youenn Fablet  <youenn@apple.com>
1667
1668         [Fetch API] Implement abortable fetch
1669         https://bugs.webkit.org/show_bug.cgi?id=174980
1670         <rdar://problem/46861402>
1671
1672         Reviewed by Chris Dumez.
1673
1674         Add an AbortSignal to FetchRequest.
1675
1676         Add support for AbortSignal algorithm.
1677         The fetch request signal is added an algorithm to abort the fetch.
1678         Update clone algorithm to let signal of the cloned request be following the origin request.
1679
1680         Update ReadableStream error handling to return an exception instead of a string.
1681         This allows passing an AbortError instead of a TypeError as previously done.
1682
1683         Update FetchBodyOwner to store a loading error either as an exception or as a resource error.
1684         The latter is used for passing the error from service worker back to the page.
1685         The former is used to pass it to ReadableStream or body accessors.
1686
1687         Covered by enabled tests.
1688
1689         * Modules/cache/DOMCache.cpp:
1690         (WebCore::DOMCache::put):
1691         * Modules/fetch/FetchBody.cpp:
1692         (WebCore::FetchBody::consumeAsStream):
1693         (WebCore::FetchBody::loadingFailed):
1694         * Modules/fetch/FetchBody.h:
1695         * Modules/fetch/FetchBodyConsumer.cpp:
1696         (WebCore::FetchBodyConsumer::loadingFailed):
1697         * Modules/fetch/FetchBodyConsumer.h:
1698         * Modules/fetch/FetchBodyOwner.cpp:
1699         (WebCore::FetchBodyOwner::arrayBuffer):
1700         (WebCore::FetchBodyOwner::blob):
1701         (WebCore::FetchBodyOwner::cloneBody):
1702         (WebCore::FetchBodyOwner::formData):
1703         (WebCore::FetchBodyOwner::json):
1704         (WebCore::FetchBodyOwner::text):
1705         (WebCore::FetchBodyOwner::loadBlob):
1706         (WebCore::FetchBodyOwner::blobLoadingFailed):
1707         (WebCore::FetchBodyOwner::consumeBodyAsStream):
1708         (WebCore::FetchBodyOwner::setLoadingError):
1709         * Modules/fetch/FetchBodyOwner.h:
1710         (WebCore::FetchBodyOwner::loadingError const):
1711         (WebCore::FetchBodyOwner::loadingException const):
1712         * Modules/fetch/FetchBodySource.cpp:
1713         (WebCore::FetchBodySource::error):
1714         * Modules/fetch/FetchBodySource.h:
1715         * Modules/fetch/FetchRequest.cpp:
1716         (WebCore::FetchRequest::initializeWith):
1717         (WebCore::FetchRequest::clone):
1718         * Modules/fetch/FetchRequest.h:
1719         (WebCore::FetchRequest::FetchRequest):
1720         * Modules/fetch/FetchRequest.idl:
1721         * Modules/fetch/FetchRequestInit.h:
1722         (WebCore::FetchRequestInit::hasMembers const):
1723         * Modules/fetch/FetchRequestInit.idl:
1724         * Modules/fetch/FetchResponse.cpp:
1725         (WebCore::FetchResponse::clone):
1726         (WebCore::FetchResponse::fetch):
1727         (WebCore::FetchResponse::BodyLoader::didFail):
1728         * Modules/fetch/FetchResponse.h:
1729         * bindings/js/ReadableStreamDefaultController.h:
1730         (WebCore::ReadableStreamDefaultController::error):
1731         * dom/AbortSignal.cpp:
1732         (WebCore::AbortSignal::abort):
1733         (WebCore::AbortSignal::follow):
1734         * dom/AbortSignal.h:
1735
1736 2019-01-04  Brent Fulgham  <bfulgham@apple.com>
1737
1738         Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox
1739         https://bugs.webkit.org/show_bug.cgi?id=193155
1740         <rdar://problem/40230982>
1741
1742         Reviewed by Chris Dumez.
1743
1744         Test: fast/loader/comment-only-javascript-url.html
1745
1746         Make a special case for URLs beginning with 'javascript:'. We should always
1747         treat these as JS URLs, even if the content contained within the URL
1748         string might match other parts of the URL parsing spec.
1749
1750         * html/URLUtils.h:
1751         (WebCore::URLUtils<T>::protocol const):
1752
1753 2019-01-04  Jer Noble  <jer.noble@apple.com>
1754
1755         [WebKitLegacy] Media playback pauses on scroll
1756         https://bugs.webkit.org/show_bug.cgi?id=192829
1757
1758         Reviewed by Eric Carlson.
1759
1760         New API tests:
1761             WebKitLegacy.ScrollingDoesNotPauseMedia
1762             WKWebView.StopAllMediaPlayback
1763             WKWebView.SuspendResumeAllMediaPlayback
1764
1765         Do not use suspendActiveDOMObjects(ReasonForSuspension::PageWillBeSuspended) to pause
1766         video. Roll back the changes to HTMLMediaElement, and introduce a new set of Page calls
1767         suspendAllMediaPlayback() & resumeAllMediaPlayback() which replaces the removed bahavior.
1768
1769         * dom/Document.cpp:
1770         (WebCore::Document::~Document):
1771         (WebCore::Document::stopAllMediaPlayback):
1772         (WebCore::Document::suspendAllMediaPlayback):
1773         (WebCore::Document::resumeAllMediaPlayback):
1774         * dom/Document.h:
1775         * html/HTMLMediaElement.cpp:
1776         (WebCore::HTMLMediaElement::HTMLMediaElement):
1777         (WebCore::HTMLMediaElement::parseAttribute):
1778         (WebCore::HTMLMediaElement::didFinishInsertingNode):
1779         (WebCore::HTMLMediaElement::setSrcObject):
1780         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1781         (WebCore::HTMLMediaElement::suspend):
1782         (WebCore::HTMLMediaElement::resume):
1783         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
1784         * html/HTMLMediaElement.h:
1785         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
1786         * html/MediaElementSession.cpp:
1787         (WebCore::MediaElementSession::playbackPermitted const):
1788         * page/Page.cpp:
1789         (WebCore::Page::stopAllMediaPlayback):
1790         (WebCore::Page::suspendAllMediaPlayback):
1791         (WebCore::Page::resumeAllMediaPlayback):
1792         * page/Page.h:
1793         (WebCore::Page::mediaPlaybackIsSuspended):
1794         * platform/audio/PlatformMediaSession.h:
1795         * platform/audio/PlatformMediaSessionManager.cpp:
1796         (WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument):
1797         (WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument):
1798         * platform/audio/PlatformMediaSessionManager.h:
1799
1800 2019-01-04  Chris Dumez  <cdumez@apple.com>
1801
1802         Add support for toggling device orientation API support per site
1803         https://bugs.webkit.org/show_bug.cgi?id=193143
1804         <rdar://problem/46605724>
1805
1806         Reviewed by Alex Christensen.
1807
1808         Add support for toggling device orientation API support per site via _WKWebsitePolicies.
1809
1810         * dom/Document.cpp:
1811         (WebCore::Document::simulateDeviceOrientationChange):
1812         * dom/Document.h:
1813         * loader/DocumentLoader.h:
1814         (WebCore::DocumentLoader::deviceOrientationEventEnabled const):
1815         (WebCore::DocumentLoader::setDeviceOrientationEventEnabled):
1816         * page/DOMWindow.cpp:
1817         (WebCore::DOMWindow::addEventListener):
1818
1819 2019-01-04  Jer Noble  <jer.noble@apple.com>
1820
1821         Web Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples for many seconds on imgur.com
1822         https://bugs.webkit.org/show_bug.cgi?id=191806
1823         <rdar://problem/46151477>
1824
1825         Reviewed by Dean Jackson.
1826
1827         Test: http/tests/images/mp4-partial-load.html
1828
1829         Rather than use an AVAssetReaderTrackOutput, which will load both sample metadata and sample data
1830         synchronously when a sample is requested, use AVAssetReaderSampleReferenceOutput, which only loads
1831         sample metadata, including the byte offset and byte length of the sample data. By waiting until the
1832         AVAsset signals that it's own metadata is loaded, we can safely parse all the sample metadata without
1833         blocking on network loads. Once enough data is loaded, we can replace the byte reference and offset
1834         attachements in the sample with actual data, and mark the sample as "complete".
1835
1836         Because the existing ImageSource assumes that image data parsing will occur synchronously, and that
1837         synchronous parsing could cause a hang if the metadata is not loaded, add a new callback method which
1838         allows the ImageSource to be notified when the encodedDataStatus changes. The ImageSource notifies the
1839         CacheImage, which notifies the RenderImage, and thus the asynchronous parsing will kick off the
1840         renderer's animation loop.
1841
1842         * loader/cache/CachedImage.cpp:
1843         (WebCore::CachedImage::CachedImageObserver::encodedDataStatusChanged):
1844         (WebCore::CachedImage::encodedDataStatusChanged):
1845         * loader/cache/CachedImage.h:
1846         * platform/graphics/ImageDecoder.h:
1847         (WebCore::ImageDecoder::setEncodedDataStatusChangeCallback):
1848         * platform/graphics/ImageObserver.h:
1849         (WebCore::ImageObserver::encodedDataStatusChanged):
1850         * platform/graphics/ImageSource.cpp:
1851         (WebCore::ImageSource::ensureDecoderAvailable):
1852         (WebCore::ImageSource::encodedDataStatusChanged):
1853         (WebCore::ImageSource::frameDecodingStatusAtIndex):
1854         * platform/graphics/ImageSource.h:
1855         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
1856         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1857         (-[WebCoreSharedBufferResourceLoaderDelegate data]):
1858         (WebCore::ImageDecoderAVFObjCSample::byteRange const):
1859         (WebCore::ImageDecoderAVFObjC::readSamples):
1860         (WebCore::ImageDecoderAVFObjC::setEncodedDataStatusChangeCallback):
1861         (WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
1862         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
1863         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
1864         (WebCore::ImageDecoderAVFObjC::sampleIsComplete const):
1865
1866 2019-01-04  Youenn Fablet  <youenn@apple.com>
1867
1868         CSP violation reports should bypass CSP checks
1869         https://bugs.webkit.org/show_bug.cgi?id=192857
1870         <rdar://problem/46887236>
1871
1872         Reviewed by Chris Dumez.
1873
1874         For ping loads, pass the option to do CSP checks from PingLoader to LoaderStrategy.
1875         This new option is unused by WebKit Legacy.
1876         It is used by WebKit loader strategy to only send any CSP response header to network process
1877         in case CSP checks should be done.
1878
1879         This option is used to disable CSP checks for Ping Loads that report CSP violations.
1880
1881         Test: http/wpt/fetch/csp-reports-bypass-csp-checks.html
1882
1883         * loader/LoaderStrategy.h:
1884         * loader/PingLoader.cpp:
1885         (WebCore::PingLoader::loadImage):
1886         (WebCore::PingLoader::sendPing):
1887         (WebCore::PingLoader::sendViolationReport):
1888         (WebCore::PingLoader::startPingLoad):
1889         * loader/PingLoader.h:
1890         * loader/cache/CachedResource.cpp:
1891         (WebCore::CachedResource::load):
1892
1893 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1894
1895         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
1896         https://bugs.webkit.org/show_bug.cgi?id=193129
1897
1898         Reviewed by Tim Horton.
1899
1900         Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.
1901
1902         * Sources.txt:
1903         * WebCore.xcodeproj/project.pbxproj:
1904         * editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.
1905         (WebCore::nameForUndoRedo):
1906         * editing/EditAction.h:
1907         * editing/Editor.cpp:
1908
1909 2019-01-03  Matt Rajca  <mrajca@apple.com>
1910
1911         Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
1912         https://bugs.webkit.org/show_bug.cgi?id=193128
1913         rdar://34554231
1914
1915         Reviewed by Jer Noble.
1916
1917         Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
1918         media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
1919         event along with a flag that indicates whether or not autoplay was actually prevented.
1920         Moreover, we can include a flag that indicates whether the media element in question
1921         is main content. Clients will then know in more cases when media was played with a user
1922         gesture, whether or not it has audio, as well as its main content status. While the main
1923         content heuristics may not be perfect, they covered the top 20 video-centric websites that
1924         this was tested with and are meant to be used by clients for data evaluation purposes.
1925
1926         As part of this, the PlaybackWithoutUserGesture enum was renamed to AutoplayEventPlaybackState
1927         since it now also applies to cases where there is a user gesture. The
1928         `m_playbackWithoutUserGestureStartedTime` member variable was also removed in favor of
1929         `playbackStartedTime` which also covers all the cases we care about.
1930
1931         Tests: existing API tests were updated to reflect the new names. New API tests
1932         were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
1933
1934         * html/HTMLMediaElement.cpp:
1935         (WebCore::convertEnumerationToString): Update to new enum cases.
1936         (WebCore::HTMLMediaElement::setReadyState): Ditto.
1937         (WebCore::HTMLMediaElement::play): Ditto.
1938         (WebCore::HTMLMediaElement::playInternal): Also cover the case where
1939          playback was not prevented but there was a user gesture.
1940         (WebCore::HTMLMediaElement::pauseInternal): Use new name.
1941         (WebCore::HTMLMediaElement::setVolume): Use new name.
1942         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Dispatch the
1943          DidPlayMediaWithUserGesture event when playback was started with a user
1944          gesture as well.
1945         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Use new name.
1946         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
1947         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
1948         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
1949         (WebCore::HTMLMediaElement::handleAutoplayEvent): Pass along new media state.
1950         (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Use new name.
1951         (WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): Stop setting
1952          m_playbackWithoutUserGestureStartedTime in favor of using playbackStartedTime.
1953         (WebCore::HTMLMediaElement::updateShouldPlay): Use new name.
1954         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Renamed.
1955         * html/HTMLMediaElement.h:
1956         (WTF::LogArgument<WebCore::HTMLMediaElement::AutoplayEventPlaybackState>::toString): Renamed from...
1957         (WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):
1958         * html/MediaElementSession.cpp:
1959         (WebCore::MediaElementSession::isMainContentForPurposesOfAutoplayEvents const): Don't
1960          do the hit testing check for the purposes of autoplay events. It seems to fail on the
1961          basic Vimeo player due to overlapping divs.
1962         (WebCore::isElementMainContentForPurposesOfAutoplay):
1963         (WebCore::MediaElementSession::updateIsMainContent const): Keep the existing behavior
1964          here of hit testing.
1965         (WebCore::isMainContentForPurposesOfAutoplay): Renamed.
1966         * html/MediaElementSession.h:
1967         * page/AutoplayEvent.h:
1968
1969 2019-01-04  Youenn Fablet  <youenn@apple.com>
1970
1971         Crash in WebCore::ServiceWorkerGlobalScope
1972         https://bugs.webkit.org/show_bug.cgi?id=192513
1973         <rdar://problem/46563880>
1974
1975         Reviewed by Alex Christensen.
1976
1977         Store the identifier in its own variable to make sure we do not use workerThread after being moved.
1978
1979         * workers/service/ServiceWorkerGlobalScope.cpp:
1980         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
1981
1982 2019-01-04  Chris Fleizach  <cfleizach@apple.com>
1983
1984         AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
1985         https://bugs.webkit.org/show_bug.cgi?id=193041
1986         <rdar://problem/46954090>
1987
1988         Reviewed by Zalan Bujtas.
1989
1990         * en.lproj/Localizable.strings:
1991         * platform/cocoa/LocalizedStringsCocoa.mm:
1992         (WebCore::AXHorizontalRuleDescriptionText):
1993
1994 2019-01-04  Zalan Bujtas  <zalan@apple.com>
1995
1996         [LFC] ComputedHorizontalMargin should have optional members
1997         https://bugs.webkit.org/show_bug.cgi?id=193131
1998
1999         Reviewed by Antti Koivisto.
2000
2001         Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional.
2002         (see computed vs used values)
2003
2004         * layout/FormattingContext.h:
2005         * layout/FormattingContextGeometry.cpp:
2006         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2007         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2008         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2009         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2010         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2011         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
2012         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted.
2013         * layout/LayoutUnits.h:
2014         * layout/MarginTypes.h:
2015         * layout/Verification.cpp:
2016         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2017         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2018         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2019         * layout/displaytree/DisplayBox.h:
2020         (WebCore::Display::Box::setHorizontalMargin):
2021         (WebCore::Display::Box::setHorizontalComputedMargin):
2022         (WebCore::Display::Box::computedMarginStart const):
2023         (WebCore::Display::Box::computedMarginEnd const):
2024         * layout/floats/FloatAvoider.h:
2025         (WebCore::Layout::FloatAvoider::marginStart const):
2026         (WebCore::Layout::FloatAvoider::marginEnd const):
2027         * layout/inlineformatting/InlineFormattingContext.cpp:
2028         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2029         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2030         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2031
2032 2019-01-04  Zalan Bujtas  <zalan@apple.com>
2033
2034         [LFC][BFC] Use computedValue and usedValue consistently
2035         https://bugs.webkit.org/show_bug.cgi?id=193059
2036
2037         Reviewed by Antti Koivisto.
2038
2039         https://www.w3.org/TR/CSS22/cascade.html#value-stages
2040
2041         6.1.2 Computed values
2042         Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units
2043         are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document...
2044
2045         6.1.3 Used values
2046         Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document
2047         is being laid out. For example, if the width of an element is set to be a certain percentage of its containing block, the width cannot be determined
2048         until the width of the containing block has been determined. The used value is the result of taking the computed value and resolving any remaining
2049         dependencies into an absolute value.
2050
2051         * layout/FormattingContext.cpp:
2052         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2053         * layout/FormattingContextGeometry.cpp:
2054         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2055         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2056         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2057         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2058         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2059         * layout/LayoutState.cpp:
2060         (WebCore::Layout::LayoutState::LayoutState):
2061         * layout/LayoutUnits.h:
2062         * layout/Verification.cpp:
2063         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2064         * layout/blockformatting/BlockFormattingContext.cpp:
2065         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2066         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2067         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2068         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2069         * layout/displaytree/DisplayBox.cpp:
2070         (WebCore::Display::Box::Box):
2071         * layout/displaytree/DisplayBox.h:
2072         (WebCore::Display::Box::setHasValidHorizontalComputedMargin):
2073         (WebCore::Display::Box::setHorizontalComputedMargin):
2074         (WebCore::Display::Box::computedMarginStart const):
2075         (WebCore::Display::Box::computedMarginEnd const):
2076         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted.
2077         (WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted.
2078         (WebCore::Display::Box::nonComputedMarginStart const): Deleted.
2079         (WebCore::Display::Box::nonComputedMarginEnd const): Deleted.
2080         * layout/floats/FloatAvoider.h:
2081         (WebCore::Layout::FloatAvoider::marginStart const):
2082         (WebCore::Layout::FloatAvoider::marginEnd const):
2083         * layout/inlineformatting/InlineFormattingContext.cpp:
2084         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
2085
2086 2019-01-03  Zalan Bujtas  <zalan@apple.com>
2087
2088         REGRESSION: -webkit-appearance test case crashes
2089         https://bugs.webkit.org/show_bug.cgi?id=189302
2090         <rdar://problem/44143049>
2091
2092         Reviewed by Wenson Hsieh.
2093
2094         The painting and the layout positions of the cancel button need to match in order to be able to interact with it.
2095         This patch removes the previous position inlining attempts.
2096
2097         Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html
2098
2099         * rendering/RenderThemeMac.mm:
2100         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2101
2102 2019-01-03  David Kilzer  <ddkilzer@apple.com>
2103
2104         Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
2105         <https://webkit.org/b/193122>
2106         <rdar://problem/47022987>
2107
2108         Reviewed by Youenn Fablet.
2109
2110         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
2111         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const):
2112         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const):
2113         - Remove `final` keyword so that
2114           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
2115           can be called.
2116         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
2117         - To fix the leak call
2118           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
2119           to create the object.
2120
2121 2019-01-03  Simon Fraser  <simon.fraser@apple.com>
2122
2123         REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset)
2124         https://bugs.webkit.org/show_bug.cgi?id=193124
2125         rdar://problem/46755409
2126
2127         Reviewed by Tim Horton.
2128
2129         Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger
2130         an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry().
2131         So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code
2132         path that runs when top content inset changes.
2133
2134         Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression.
2135
2136         * rendering/RenderLayerCompositor.cpp:
2137         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
2138
2139 2019-01-03  Chris Dumez  <cdumez@apple.com>
2140
2141         Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
2142         https://bugs.webkit.org/show_bug.cgi?id=192997
2143         <rdar://problem/46217271>
2144
2145         Reviewed by Antti Koivisto.
2146
2147         isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers.
2148         The issue is that a Frame can be its opener. There could also be a cycle in the opener chain.
2149
2150         To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now
2151         only check if the frames belong to the same pages or if their openers do. We no longer check
2152         openers' opener and up.
2153
2154         Note that this function is used to check if a frame is allowed to target another. In practice,
2155         it is unlikely to be useful to navigate an opener's opener and an openee's openee.
2156
2157         Tests: fast/dom/Window/window-open-opener-cycle.html
2158                fast/dom/Window/window-open-self-as-opener.html
2159
2160         * page/FrameTree.cpp:
2161         (WebCore::isFrameFamiliarWith):
2162
2163 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2164
2165         REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
2166         https://bugs.webkit.org/show_bug.cgi?id=193095
2167         <rdar://problem/47014944>
2168
2169         Reviewed by Zalan Bujtas.
2170         
2171         In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
2172         and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
2173         which continues to affect the appearance of text.
2174         
2175         Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
2176
2177         Test: compositing/contents-format/subpixel-antialiased-text.html
2178
2179         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2180         (WebCore::PlatformCALayer::drawLayerContents):
2181
2182 2019-01-02  David Kilzer  <ddkilzer@apple.com>
2183
2184         Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
2185         <https://webkit.org/b/193016>
2186         <rdar://problem/46925703>
2187
2188         Reviewed by Simon Fraser.
2189
2190         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2191         (WebCore::copySampleBufferWithCurrentTimeStamp):
2192         - Change to return RetainPtr<CMSampleBufferRef>.
2193         - Check return value of CMSampleBufferCreateCopyWithNewTiming().
2194         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
2195         - Check return value of copySampleBufferWithCurrentTimeStamp().
2196         - Fix leak by using RetainPtr<CMSampleBufferRef> returned from
2197           copySampleBufferWithCurrentTimeStamp() instead of leaking
2198           `bufferWithCurrentTime` by using retainPtr().
2199         (WebCore::createAudioFormatDescription):
2200         - Extract method from appendAudioSampleBuffer() to return
2201           RetainPtr<CMFormatDescriptionRef> after calling
2202           CMAudioFormatDescriptionCreate().
2203         - Check return value of CMAudioFormatDescriptionCreate().
2204         (WebCore::createAudioSampleBufferWithPacketDescriptions):
2205         - Extract method from appendAudioSampleBuffer() to return
2206           RetainPtr<CMSampleBufferRef> after calling
2207           CMAudioSampleBufferCreateWithPacketDescriptions().
2208         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
2209         - Check return values of createAudioFormatDescription() and
2210           createAudioSampleBufferWithPacketDescriptions().
2211         - Fix leaks by extracting code into helper methods that return
2212           RetainPtr<> objects instead of leaking CMFormatDescriptionRef
2213           directly or leaking `sampleBuffer` by using retainPtr().
2214
2215 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2216
2217         Add support for using the current text selection as the find string on iOS
2218         https://bugs.webkit.org/show_bug.cgi?id=193034
2219         <rdar://problem/45138739>
2220
2221         Reviewed by Tim Horton.
2222
2223         Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
2224         pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
2225         process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
2226         able to trigger find-in-page with this string.
2227
2228         Test: WebKit.UseSelectionAsFindString
2229
2230         * editing/Editor.cpp:
2231         (WebCore::Editor::canCopyExcludingStandaloneImages const):
2232
2233         Make this helper function cross-platform.
2234
2235         * editing/Editor.h:
2236         * editing/EditorCommand.cpp:
2237         (WebCore::createCommandMap):
2238         * editing/cocoa/EditorCocoa.mm:
2239         (WebCore::Editor::takeFindStringFromSelection):
2240
2241         Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
2242         find string (see WebKit/ChangeLog for more details).
2243
2244         * editing/mac/EditorMac.mm:
2245         (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
2246         (WebCore::Editor::takeFindStringFromSelection): Deleted.
2247         * loader/EmptyClients.cpp:
2248         * page/EditorClient.h:
2249
2250         Add a new editor client method to send the string for find-in-page to the UI process.
2251
2252 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
2253
2254         Web Inspector: Implement `queryObjects` Command Line API
2255         https://bugs.webkit.org/show_bug.cgi?id=176766
2256         <rdar://problem/34890689>
2257
2258         Reviewed by Joseph Pecoraro.
2259
2260         Test: inspector/console/queryObjects.html
2261
2262         * inspector/CommandLineAPIModuleSource.js:
2263         (CommandLineAPI):
2264         (CommandLineAPIImpl.prototype.queryObjects): Added.
2265
2266 2019-01-02  Charles Vazac  <cvazac@gmail.com>
2267
2268         Fix resourcetimingbufferfull bubbles attribute
2269         https://bugs.webkit.org/show_bug.cgi?id=193087
2270
2271         Reviewed by Chris Dumez.
2272
2273         This change is covered by web-platform-tests [1].
2274
2275         [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
2276
2277         * page/Performance.cpp:
2278         (WebCore::Performance::resourceTimingBufferFullTimerFired):
2279
2280 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2281
2282         Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
2283         https://bugs.webkit.org/show_bug.cgi?id=193010
2284
2285         Reviewed by Zalan Bujtas.
2286
2287         Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
2288         and make it an enum class.
2289
2290         * page/FrameView.cpp:
2291         (WebCore::FrameView::scrollLayerID const):
2292         * rendering/RenderLayer.h:
2293         * rendering/RenderLayerBacking.cpp:
2294         (WebCore::RenderLayerBacking::~RenderLayerBacking):
2295         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2296         (WebCore::operator<<):
2297         * rendering/RenderLayerBacking.h:
2298         * rendering/RenderLayerCompositor.cpp:
2299         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
2300         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
2301         (WebCore::scrollCoordinationRoleForNodeType):
2302         (WebCore::RenderLayerCompositor::attachScrollingNode):
2303         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
2304         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2305         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
2306         * rendering/RenderLayerCompositor.h:
2307
2308 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2309
2310         Don't spin up a CalcParser if the current token is not a function token
2311         https://bugs.webkit.org/show_bug.cgi?id=193067
2312
2313         Reviewed by Zalan Bujtas.
2314
2315         Various functions in CSSPropertyParserHelpers fall back to trying to parse
2316         a calc expression if the normal parsing fails. Don't do this unless the
2317         current token is a function token, which should be slightly more efficient.
2318
2319         * css/parser/CSSPropertyParserHelpers.cpp:
2320         (WebCore::CSSPropertyParserHelpers::consumeInteger):
2321         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
2322         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
2323         (WebCore::CSSPropertyParserHelpers::consumeNumber):
2324         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
2325         (WebCore::CSSPropertyParserHelpers::consumeLength):
2326         (WebCore::CSSPropertyParserHelpers::consumePercent):
2327         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
2328         (WebCore::CSSPropertyParserHelpers::consumeAngle):
2329         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
2330         (WebCore::CSSPropertyParserHelpers::consumeTime):
2331
2332 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2333
2334         Support css-color-4 rgb functions
2335         https://bugs.webkit.org/show_bug.cgi?id=192321
2336
2337         Reviewed by Zalan Bujtas.
2338         
2339         Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
2340         The differences are:
2341         1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
2342             rgb(128 34 56)
2343             rgb(128 34 56 / 50%)
2344         2. Floating point values are allowed, and rounded:
2345             rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
2346         3. rgba() is a pure alias for rgb(), so these are equivalent:
2347             rgb(128 34 56 / 50%)
2348             rgba(128 34 56 / 50%)
2349             
2350         hsl()/hsla() parsing was already updated to this new syntax in r230861.
2351
2352         Tested by tests in imported/w3c/web-platform-tests/css/css-color/
2353
2354         * css/parser/CSSPropertyParserHelpers.cpp:
2355         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
2356         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
2357         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
2358
2359 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2360
2361         Handle calc() expressions in gradient color stops
2362         https://bugs.webkit.org/show_bug.cgi?id=193066
2363         rdar://problem/46961985
2364
2365         Reviewed by Sam Weinig.
2366         
2367         Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
2368         for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
2369         calc values as well as angle ones.
2370
2371         Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
2372         just as isPx() etc do.
2373
2374         Test: fast/gradients/conic-calc-stop-position.html
2375
2376         * css/CSSPrimitiveValue.h:
2377         (WebCore::CSSPrimitiveValue::isAngle const):
2378         * css/parser/CSSPropertyParserHelpers.cpp:
2379         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
2380         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
2381
2382 2018-12-31  Keith Miller  <keith_miller@apple.com>
2383
2384         SourceProviders should use an actual URL instead of a string
2385         https://bugs.webkit.org/show_bug.cgi?id=192734
2386
2387         Reviewed by Yusuke Suzuki.
2388
2389         Remove ScriptSourceCode's URL member and make the url() method
2390         reference the URL on the SourceProvider. Also, avoid some
2391         ref count churn.
2392
2393         Additionally, this patch fixes an existing bug in
2394         WorkletGlobalScope() that would use a ScriptSourceCode after
2395         WTFMoving it.
2396
2397         * bindings/js/CachedScriptSourceProvider.h:
2398         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
2399         * bindings/js/ScheduledAction.cpp:
2400         (WebCore::ScheduledAction::execute):
2401         * bindings/js/ScriptController.cpp:
2402         (WebCore::ScriptController::executeScriptInWorld):
2403         (WebCore::ScriptController::executeScript):
2404         * bindings/js/ScriptSourceCode.h:
2405         (WebCore::ScriptSourceCode::ScriptSourceCode):
2406         (WebCore::ScriptSourceCode::m_code):
2407         (WebCore::ScriptSourceCode::url const):
2408         (WebCore::ScriptSourceCode::m_url): Deleted.
2409         * dom/ScriptElement.cpp:
2410         (WebCore::ScriptElement::prepareScript):
2411         (WebCore::ScriptElement::requestModuleScript):
2412         (WebCore::ScriptElement::executePendingScript):
2413         * html/HTMLMediaElement.cpp:
2414         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
2415         * page/Frame.cpp:
2416         (WebCore::Frame::injectUserScriptImmediately):
2417         * workers/WorkerGlobalScope.cpp:
2418         (WebCore::WorkerGlobalScope::importScripts):
2419         * workers/WorkerThread.cpp:
2420         (WebCore::WorkerThread::workerThread):
2421         * worklets/WorkletGlobalScope.cpp:
2422         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
2423         * xml/parser/XMLDocumentParserLibxml2.cpp:
2424         (WebCore::XMLDocumentParser::endElementNs):
2425
2426 2019-01-01  Jeff Miller  <jeffm@apple.com>
2427
2428         Update user-visible copyright strings to include 2019
2429         https://bugs.webkit.org/show_bug.cgi?id=192811
2430
2431         Reviewed by Mark Lam.
2432
2433         * Info.plist:
2434
2435 2018-12-30  David Kilzer  <ddkilzer@apple.com>
2436
2437         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
2438         <https://webkit.org/b/193058>
2439         <rdar://problem/46979275>
2440
2441         Reviewed by Yusuke Suzuki.
2442
2443         * rendering/BorderEdge.cpp:
2444         (WebCore::BorderEdge::BorderEdge): Reorder initialization to
2445         match new instance variable order.
2446         * rendering/BorderEdge.h: Reorder instance variables to save
2447         8 padding bytes.
2448
2449 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2450
2451         [JSC] Remove one indirection in JSObject::toStringName
2452         https://bugs.webkit.org/show_bug.cgi?id=193037
2453
2454         Reviewed by Keith Miller.
2455
2456         Use old JSObject::toStringName function here.
2457
2458         * bindings/js/JSDOMConstructorBase.cpp:
2459         (WebCore::JSDOMConstructorBase::className):
2460         (WebCore::JSDOMConstructorBase::toStringName):
2461         * bindings/js/JSDOMConstructorBase.h:
2462         (WebCore::JSDOMConstructorBase::className): Deleted.
2463
2464 2018-12-27  Alex Christensen  <achristensen@webkit.org>
2465
2466         Resurrect Mac CMake build
2467         https://bugs.webkit.org/show_bug.cgi?id=192658
2468
2469         Reviewed by Yusuke Suzuki.
2470
2471         This makes it so JSC and most of WebCore builds.
2472         WebCore's use of ARC seems inconsistent, so I'll fix that later.
2473
2474         * PlatformMac.cmake:
2475         * config.h:
2476
2477 2018-12-26  Jim Mason  <jmason@ibinx.com>
2478
2479         [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
2480         https://bugs.webkit.org/show_bug.cgi?id=193036
2481
2482         Reviewed by Michael Catanzaro.
2483
2484         * platform/graphics/FontPlatformData.h:
2485         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2486
2487 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2488
2489         Remove "using namespace std;"
2490         https://bugs.webkit.org/show_bug.cgi?id=192973
2491         <rdar://problem/46937309>
2492
2493         Unreviewed Windows port Debug builds fix.
2494
2495         No new tests since no behavior changes.
2496
2497         * accessibility/win/AXObjectCacheWin.cpp:
2498         (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
2499
2500 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2501
2502         Remove "using namespace std;"
2503         https://bugs.webkit.org/show_bug.cgi?id=192973
2504
2505         Reviewed by Alex Christensen.
2506
2507         Removed "using namespace std" statement, and use std:: prefix.
2508
2509         No new tests since no behavior changes.
2510
2511         * accessibility/win/AXObjectCacheWin.cpp:
2512         * platform/graphics/GraphicsContext3DPrivate.cpp:
2513         * platform/graphics/cairo/ImageBufferCairo.cpp:
2514         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2515         * platform/graphics/win/FontWin.cpp:
2516         (WebCore::FontCascade::floatWidthForComplexText const):
2517         * platform/graphics/win/GraphicsContextCGWin.cpp:
2518         * platform/graphics/win/GraphicsContextCairoWin.cpp:
2519         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2520         * platform/graphics/win/GraphicsContextWin.cpp:
2521         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2522         * platform/graphics/win/UniscribeController.cpp:
2523         (WebCore::UniscribeController::UniscribeController):
2524         (WebCore::UniscribeController::shapeAndPlaceItem):
2525         * platform/image-decoders/ScalableImageDecoder.cpp:
2526         * platform/text/LocaleICU.cpp:
2527         * platform/text/win/LocaleWin.cpp:
2528         * platform/win/ScrollbarThemeWin.cpp:
2529         * rendering/RenderRubyRun.cpp:
2530         (WebCore::RenderRubyRun::layoutBlock):
2531         * rendering/RenderThemeWin.cpp:
2532         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
2533         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
2534         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
2535         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
2536         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
2537         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
2538         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
2539
2540 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
2541
2542         Change ScrollingNodeType to an enum class
2543         https://bugs.webkit.org/show_bug.cgi?id=193009
2544
2545         Reviewed by Zalan Bujtas.
2546
2547         Change the ScrollingNodeType enum to an enum class.
2548         
2549         No behavior change.
2550
2551         * page/scrolling/AsyncScrollingCoordinator.cpp:
2552         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
2553         * page/scrolling/ScrollingCoordinator.cpp:
2554         (WebCore::operator<<):
2555         * page/scrolling/ScrollingCoordinator.h:
2556         * page/scrolling/ScrollingStateFixedNode.cpp:
2557         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
2558         * page/scrolling/ScrollingStateNode.h:
2559         (WebCore::ScrollingStateNode::isFixedNode const):
2560         (WebCore::ScrollingStateNode::isStickyNode const):
2561         (WebCore::ScrollingStateNode::isFrameScrollingNode const):
2562         (WebCore::ScrollingStateNode::isOverflowScrollingNode const):
2563         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
2564         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
2565         * page/scrolling/ScrollingStateStickyNode.cpp:
2566         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
2567         * page/scrolling/ScrollingStateTree.cpp:
2568         (WebCore::ScrollingStateTree::createNode):
2569         (WebCore::ScrollingStateTree::attachNode):
2570         * page/scrolling/ScrollingTreeNode.h:
2571         (WebCore::ScrollingTreeNode::isFixedNode const):
2572         (WebCore::ScrollingTreeNode::isStickyNode const):
2573         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
2574         (WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
2575         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
2576         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
2577         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2578         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
2579         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2580         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
2581         * page/scrolling/mac/ScrollingTreeMac.cpp:
2582         (ScrollingTreeMac::createScrollingTreeNode):
2583         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2584         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
2585         * platform/graphics/GraphicsLayerClient.h:
2586         * rendering/RenderLayerCompositor.cpp:
2587         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
2588         (WebCore::scrollCoordinationRoleForNodeType):
2589         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
2590         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2591
2592 2018-12-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2593
2594         [HarfBuzz] Width not correctly reported as 0 for zero font size
2595         https://bugs.webkit.org/show_bug.cgi?id=192986
2596
2597         Reviewed by Michael Catanzaro.
2598
2599         Fixes test fast/text/font-size-zero.html
2600
2601         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2602         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
2603         size is zero.
2604
2605 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2606
2607         Use Ref<> as much as possible
2608         https://bugs.webkit.org/show_bug.cgi?id=192808
2609
2610         Reviewed by Alex Christensen.
2611
2612         * Modules/encryptedmedia/NavigatorEME.cpp:
2613         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
2614         * Modules/fetch/FetchBody.cpp:
2615         (WebCore::FetchBody::bodyAsFormData const):
2616         * Modules/geolocation/Geolocation.cpp:
2617         (WebCore::Geolocation::getCurrentPosition):
2618         (WebCore::Geolocation::watchPosition):
2619         * Modules/indexeddb/IDBDatabase.cpp:
2620         (WebCore::IDBDatabase::objectStoreNames const):
2621         * Modules/indexeddb/IDBDatabase.h:
2622         * Modules/indexeddb/IDBObjectStore.cpp:
2623         (WebCore::IDBObjectStore::indexNames const):
2624         * Modules/indexeddb/IDBObjectStore.h:
2625         * Modules/indexeddb/IDBTransaction.cpp:
2626         (WebCore::IDBTransaction::scheduleOperation):
2627         * Modules/indexeddb/IDBTransaction.h:
2628         * Modules/indexeddb/client/TransactionOperation.h:
2629         (WebCore::IDBClient::createTransactionOperation):
2630         * Modules/mediastream/MediaDevices.cpp:
2631         (WebCore::MediaDevices::getUserMedia const):
2632         (WebCore::MediaDevices::getDisplayMedia const):
2633         * Modules/mediastream/UserMediaRequest.cpp:
2634         (WebCore::UserMediaRequest::create):
2635         * Modules/mediastream/UserMediaRequest.h:
2636         * Modules/webaudio/AudioParam.cpp:
2637         (WebCore::AudioParam::calculateFinalValues):
2638         * Modules/webaudio/ScriptProcessorNode.cpp:
2639         (WebCore::ScriptProcessorNode::initialize):
2640         * Modules/webdatabase/SQLStatement.cpp:
2641         (WebCore::SQLStatement::execute):
2642         * Modules/webgpu/WebGPU.cpp:
2643         (WebCore::WebGPU::requestAdapter const):
2644         * Modules/webgpu/WebGPUAdapter.cpp:
2645         (WebCore::WebGPUAdapter::create):
2646         * Modules/webgpu/WebGPUAdapter.h:
2647         * Modules/webgpu/WebGPUBuffer.cpp:
2648         (WebCore::WebGPUBuffer::create):
2649         * Modules/webgpu/WebGPUBuffer.h:
2650         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2651         (WebCore::WebGPUCommandBuffer::create):
2652         (WebCore::WebGPUCommandBuffer::beginRenderPass):
2653         * Modules/webgpu/WebGPUCommandBuffer.h:
2654         * Modules/webgpu/WebGPUDevice.cpp:
2655         (WebCore::WebGPUDevice::create):
2656         (WebCore::WebGPUDevice::createBuffer const):
2657         (WebCore::WebGPUDevice::createShaderModule const):
2658         (WebCore::WebGPUDevice::createRenderPipeline const):
2659         (WebCore::WebGPUDevice::createCommandBuffer const):
2660         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2661         (WebCore::WebGPURenderPassEncoder::create):
2662         * Modules/webgpu/WebGPURenderPassEncoder.h:
2663         * Modules/webgpu/WebGPURenderPipeline.cpp:
2664         (WebCore::WebGPURenderPipeline::create):
2665         * Modules/webgpu/WebGPURenderPipeline.h:
2666         * Modules/webgpu/WebGPUShaderModule.cpp:
2667         (WebCore::WebGPUShaderModule::create):
2668         * Modules/webgpu/WebGPUShaderModule.h:
2669         * Modules/webgpu/WebGPUTexture.cpp:
2670         (WebCore::WebGPUTexture::createDefaultTextureView):
2671         * Modules/webgpu/WebGPUTextureView.cpp:
2672         (WebCore::WebGPUTextureView::create):
2673         * Modules/webgpu/WebGPUTextureView.h:
2674         * accessibility/AXObjectCache.cpp:
2675         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
2676         * accessibility/atk/AXObjectCacheAtk.cpp:
2677         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
2678         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2679         (webkitAccessibleHyperlinkGetStartIndex):
2680         (webkitAccessibleHyperlinkGetEndIndex):
2681         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2682         (getSelectionOffsetsForObject):
2683         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2684         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
2685         * bindings/js/JSDOMGlobalObjectTask.cpp:
2686         * bindings/js/JSDOMWindowBase.cpp:
2687         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
2688         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2689         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
2690         * bindings/js/ScriptControllerMac.mm:
2691         (WebCore::ScriptController::createScriptInstanceForWidget):
2692         * bindings/js/SerializedScriptValue.cpp:
2693         (WebCore::CloneDeserializer::readTerminal):
2694         (WebCore::SerializedScriptValue::create):
2695         * bridge/objc/objc_instance.h:
2696         * bridge/objc/objc_instance.mm:
2697         (ObjcInstance::create):
2698         * css/CSSComputedStyleDeclaration.cpp:
2699         (WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
2700         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
2701         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
2702         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
2703         * css/CSSComputedStyleDeclaration.h:
2704         * css/CSSFontFaceSource.cpp:
2705         (WebCore::CSSFontFaceSource::load):
2706         * css/CSSStyleSheet.cpp:
2707         (WebCore::CSSStyleSheet::rules):
2708         * css/FontFace.cpp:
2709         (WebCore::FontFace::unicodeRange const):
2710         (WebCore::FontFace::featureSettings const):
2711         * css/InspectorCSSOMWrappers.cpp:
2712         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
2713         * css/SVGCSSComputedStyleDeclaration.cpp:
2714         (WebCore::strokeDashArrayToCSSValueList):
2715         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
2716         * css/StyleResolver.cpp:
2717         (WebCore::StyleResolver::createFilterOperations):
2718         * css/StyleRule.cpp:
2719         (WebCore::StyleRuleBase::createCSSOMWrapper const):
2720         * css/StyleRule.h:
2721         * dom/ChildListMutationScope.cpp:
2722         (WebCore::ChildListMutationAccumulator::getOrCreate):
2723         * dom/ChildListMutationScope.h:
2724         * dom/DocumentMarkerController.cpp:
2725         (WebCore::updateRenderedRectsForMarker):
2726         * dom/InlineStyleSheetOwner.cpp:
2727         (WebCore::InlineStyleSheetOwner::createSheet):
2728         * dom/PointerEvent.h:
2729         * dom/UserGestureIndicator.h:
2730         (WebCore::UserGestureToken::create):
2731         * editing/AlternativeTextController.cpp:
2732         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2733         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
2734         (WebCore::AlternativeTextController::respondToUnappliedEditing):
2735         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
2736         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
2737         * editing/ApplyStyleCommand.cpp:
2738         (WebCore::ApplyStyleCommand::applyBlockStyle):
2739         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
2740         * editing/CompositeEditCommand.cpp:
2741         (WebCore::CompositeEditCommand::targetRanges const):
2742         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
2743         (WebCore::CompositeEditCommand::moveParagraphs):
2744         * editing/DeleteSelectionCommand.cpp:
2745         (WebCore::DeleteSelectionCommand::mergeParagraphs):
2746         * editing/Editing.cpp:
2747         (WebCore::visiblePositionForIndexUsingCharacterIterator):
2748         * editing/EditingStyle.cpp:
2749         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
2750         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
2751         (WebCore::EditingStyle::prepareToApplyAt):
2752         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
2753         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
2754         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
2755         (WebCore::extractPropertiesNotIn):
2756         * editing/Editor.cpp:
2757         (WebCore::Editor::setBaseWritingDirection):
2758         (WebCore::Editor::setComposition):
2759         * editing/EditorCommand.cpp:
2760         (WebCore::executeApplyParagraphStyle):
2761         (WebCore::executeMakeTextWritingDirectionLeftToRight):
2762         (WebCore::executeMakeTextWritingDirectionNatural):
2763         (WebCore::executeMakeTextWritingDirectionRightToLeft):
2764         * editing/FormatBlockCommand.cpp:
2765         (WebCore::FormatBlockCommand::formatRange):
2766         * editing/RemoveFormatCommand.cpp:
2767         (WebCore::RemoveFormatCommand::doApply):
2768         * editing/ReplaceRangeWithTextCommand.cpp:
2769         (WebCore::ReplaceRangeWithTextCommand::targetRanges const):
2770         * editing/ReplaceSelectionCommand.cpp:
2771         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
2772         (WebCore::handleStyleSpansBeforeInsertion):
2773         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
2774         * editing/SpellingCorrectionCommand.cpp:
2775         (WebCore::SpellingCorrectionCommand::targetRanges const):
2776         * editing/TextCheckingHelper.cpp:
2777         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2778         * editing/TypingCommand.cpp:
2779         (WebCore::TypingCommand::insertText):
2780         (WebCore::TypingCommand::willAddTypingToOpenCommand):
2781         * editing/VisibleUnits.cpp:
2782         (WebCore::distanceBetweenPositions):
2783         * editing/cocoa/EditorCocoa.mm:
2784         (WebCore::Editor::selectionInWebArchiveFormat):
2785         * editing/ios/DictationCommandIOS.cpp:
2786         (WebCore::DictationCommandIOS::doApply):
2787         * editing/ios/EditorIOS.mm:
2788         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
2789         (WebCore::Editor::removeUnchangeableStyles):
2790         (WebCore::Editor::writeImageToPasteboard):
2791         * editing/mac/EditorMac.mm:
2792         (WebCore::Editor::replaceNodeFromPasteboard):
2793         (WebCore::Editor::imageInWebArchiveFormat):
2794         * editing/markup.cpp:
2795         (WebCore::styleFromMatchedRulesAndInlineDecl):
2796         (WebCore::createFragmentForTransformToFragment):
2797         * fileapi/FileReaderLoader.cpp:
2798         (WebCore::FileReaderLoader::didFinishLoading):
2799         * html/FTPDirectoryDocument.cpp:
2800         (WebCore::createTemplateDocumentData):
2801         * html/HTMLMediaElement.cpp:
2802         (WebCore::HTMLMediaElement::scheduleEvent):
2803         (WebCore::HTMLMediaElement::createMediaControls):
2804         * html/HTMLTableElement.cpp:
2805         (WebCore::HTMLTableElement::createSharedCellStyle):
2806         * html/HTMLTableElement.h:
2807         * html/URLUtils.h:
2808         (WebCore::URLUtils<T>::origin const):
2809         * html/parser/HTMLConstructionSite.cpp:
2810         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
2811         * html/shadow/TextControlInnerElements.cpp:
2812         (WebCore::TextControlInnerElement::resolveCustomStyle):
2813         * html/track/WebVTTParser.cpp:
2814         (WebCore::WebVTTParser::createNewCue):
2815         * inspector/DOMPatchSupport.cpp:
2816         * inspector/InspectorCanvas.cpp:
2817         (WebCore::InspectorCanvas::buildInitialState):
2818         (WebCore::InspectorCanvas::buildAction):
2819         * inspector/InspectorFrontendClientLocal.cpp:
2820         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2821         * inspector/InspectorStyleSheet.cpp:
2822         (WebCore::asCSSRuleList):
2823         (WebCore::InspectorStyle::styleWithProperties const):
2824         (WebCore::InspectorStyleSheet::ensureSourceData):
2825         * inspector/agents/InspectorCanvasAgent.cpp:
2826         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
2827         * inspector/agents/InspectorIndexedDBAgent.cpp:
2828         (WebCore::Inspector::keyPathFromIDBKeyPath):
2829         * inspector/agents/InspectorPageAgent.cpp:
2830         (WebCore::InspectorPageAgent::archive):
2831         * loader/EmptyClients.cpp:
2832         (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace):
2833         (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace):
2834         (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
2835         (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace):
2836         * loader/FrameLoader.cpp:
2837         (WebCore::FrameLoader::loadURL):
2838         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
2839         (WebCore::FrameLoader::loadDifferentDocumentItem):
2840         * loader/WorkerThreadableLoader.cpp:
2841         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
2842         * loader/archive/mhtml/MHTMLParser.cpp:
2843         (WebCore::MHTMLParser::addResourceToArchive):
2844         (WebCore::MHTMLParser::parseNextPart):
2845         * loader/cache/MemoryCache.cpp:
2846         (WebCore::MemoryCache::addImageToCache):
2847         (WebCore::MemoryCache::removeResourcesWithOrigin):
2848         * page/DOMWindow.cpp:
2849         (WebCore::DOMWindow::getMatchedCSSRules const):
2850         (WebCore::DOMWindow::createWindow):
2851         * page/EventHandler.cpp:
2852         (WebCore::textDistance):
2853         * page/Page.cpp:
2854         (WebCore::Page::userStyleSheet const):
2855         * page/animation/CSSPropertyAnimation.cpp:
2856         (WebCore::blendFilterOperations):
2857         * page/ios/FrameIOS.mm:
2858         (WebCore::Frame::initWithSimpleHTMLDocument):
2859         (WebCore::Frame::interpretationsForCurrentRoot const):
2860         * page/mac/ServicesOverlayController.mm:
2861         (WebCore::ServicesOverlayController::Highlight::fadeIn):
2862         (WebCore::ServicesOverlayController::Highlight::fadeOut):
2863         * platform/SharedBuffer.cpp:
2864         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
2865         * platform/audio/HRTFElevation.cpp:
2866         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2867         * platform/audio/SincResampler.cpp:
2868         (WebCore::SincResampler::consumeSource):
2869         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
2870         (WebCore::AudioFileReader::createBus):
2871         * platform/audio/mac/AudioFileReaderMac.cpp:
2872         (WebCore::AudioFileReader::createBus):
2873         * platform/graphics/Icon.h:
2874         (WebCore::Icon::create):
2875         * platform/graphics/InbandTextTrackPrivate.h:
2876         (WebCore::InbandTextTrackPrivate::create):
2877         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2878         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
2879         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
2880         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2881         (WebCore::fulfillRequestWithKeyData):
2882         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2883         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2884         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2885         (WebCore::MediaSourcePrivateAVFObjC::create):
2886         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
2887         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2888         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2889         (WebCore::SourceBufferPrivateAVFObjC::create):
2890         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2891         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
2892         * platform/graphics/ca/TileController.cpp:
2893         (WebCore::TileController::createTileLayer):
2894         * platform/graphics/ca/TileController.h:
2895         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2896         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
2897         (WebCore::CACFLayerTreeHost::create):
2898         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2899         (WebCore::GPUBuffer::create):
2900         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2901         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
2902         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2903         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
2904         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
2905         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2906         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
2907         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2908         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2909         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2910         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2911         (WebCore::AppendPipeline::appsinkNewSample):
2912         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
2913         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
2914         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
2915         (WebCore::ISOTrackEncryptionBox::parse):
2916         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2917         (WebCore::applyFilterAnimation):
2918         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2919         (WebCore::TextureMapperPlatformLayerBuffer::clone):
2920         * platform/graphics/transforms/TransformOperations.cpp:
2921         (WebCore::TransformOperations::blendByMatchingOperations const):
2922         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2923         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
2924         * platform/mock/mediasource/MockBox.cpp:
2925         (WebCore::MockInitializationBox::MockInitializationBox):
2926         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2927         (WebCore::MockSourceBufferPrivate::create):
2928         (WebCore::MockSourceBufferPrivate::append):
2929         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2930         * platform/mock/mediasource/MockTracks.h:
2931         (WebCore::MockTextTrackPrivate::create):
2932         (WebCore::MockVideoTrackPrivate::create):
2933         * platform/network/FormData.h:
2934         (WebCore::FormData::decode):
2935         * platform/network/cocoa/CookieStorageObserver.h:
2936         * platform/network/cocoa/CookieStorageObserver.mm:
2937         (WebCore::CookieStorageObserver::create):
2938         * platform/network/soup/ResourceRequestSoup.cpp:
2939         (WebCore::appendEncodedBlobItemToSoupMessageBody):
2940         (WebCore::ResourceRequest::updateSoupMessageBody const):
2941         * platform/text/hyphen/HyphenationLibHyphen.cpp:
2942         (WebCore::HyphenationDictionary::createNull):
2943         (WebCore::HyphenationDictionary::create):
2944         * platform/win/SearchPopupMenuWin.cpp:
2945         (WebCore::SearchPopupMenuWin::SearchPopupMenuWin):
2946         (WebCore::SearchPopupMenuWin::popupMenu):
2947         * platform/win/SearchPopupMenuWin.h:
2948         * rendering/RenderThemeIOS.mm:
2949         (WebCore::applyCommonButtonPaddingToStyle):
2950         (WebCore::RenderThemeIOS::paintProgressBar):
2951         (WebCore::RenderThemeIOS::adjustButtonStyle const):
2952         (WebCore::paintAttachmentIcon):
2953         * rendering/svg/SVGRenderTreeAsText.cpp:
2954         (WebCore::writeSVGResourceContainer):
2955         * storage/Storage.cpp:
2956         (WebCore::Storage::create):
2957         (WebCore::Storage::Storage):
2958         * storage/Storage.h:
2959         (WebCore::Storage::area const):
2960         * storage/StorageNamespace.h:
2961         * storage/StorageNamespaceProvider.cpp:
2962         (WebCore::StorageNamespaceProvider::localStorageArea):
2963         * storage/StorageNamespaceProvider.h:
2964         * svg/SVGElement.cpp:
2965         (WebCore::SVGElement::getPresentationAttribute):
2966         * svg/SVGFEBlendElement.cpp:
2967         (WebCore::SVGFEBlendElement::build):
2968         * svg/SVGFEColorMatrixElement.cpp:
2969         (WebCore::SVGFEColorMatrixElement::build):
2970         * svg/SVGFEComponentTransferElement.cpp:
2971         (WebCore::SVGFEComponentTransferElement::build):
2972         * svg/SVGFECompositeElement.cpp:
2973         (WebCore::SVGFECompositeElement::build):
2974         * svg/SVGFEDiffuseLightingElement.cpp:
2975         (WebCore::SVGFEDiffuseLightingElement::build):
2976         * svg/SVGFEDisplacementMapElement.cpp:
2977         (WebCore::SVGFEDisplacementMapElement::build):
2978         * svg/SVGFEDropShadowElement.cpp:
2979         (WebCore::SVGFEDropShadowElement::build):
2980         * svg/SVGFEGaussianBlurElement.cpp:
2981         (WebCore::SVGFEGaussianBlurElement::build):
2982         * svg/SVGFEMergeElement.cpp:
2983         (WebCore::SVGFEMergeElement::build):
2984         * svg/SVGFEMorphologyElement.cpp:
2985         (WebCore::SVGFEMorphologyElement::build):
2986         * svg/SVGFEOffsetElement.cpp:
2987         (WebCore::SVGFEOffsetElement::build):
2988         * svg/SVGFESpecularLightingElement.cpp:
2989         (WebCore::SVGFESpecularLightingElement::build):
2990         * svg/SVGFETileElement.cpp:
2991         (WebCore::SVGFETileElement::build):
2992         * testing/GCObservation.h:
2993         * xml/XSLTProcessor.cpp:
2994         (WebCore::XSLTProcessor::createDocumentFromSource):
2995         * xml/parser/XMLDocumentParser.cpp:
2996         (WebCore::XMLDocumentParser::parseDocumentFragment):
2997
2998 2018-12-21  Chris Dumez  <cdumez@apple.com>
2999
3000         navigator.userAgent in service workers does not reflect customUserAgent set by client
3001         https://bugs.webkit.org/show_bug.cgi?id=192951
3002
3003         Reviewed by Youenn Fablet.
3004
3005         Whenever a service worker client registers itself, also pass its effective user agent.
3006         In the network process, for each origin, we store the latest client's user agent and
3007         use it when starting the service worker.
3008
3009         * dom/Document.cpp:
3010         (WebCore::Document::setServiceWorkerConnection):
3011         * loader/DocumentLoader.cpp:
3012         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
3013         * workers/service/SWClientConnection.h:
3014         * workers/service/server/SWServer.cpp:
3015         (WebCore::SWServer::serviceWorkerClientUserAgent const):
3016         (WebCore::SWServer::installContextData):
3017         (WebCore::SWServer::runServiceWorker):
3018         (WebCore::SWServer::registerServiceWorkerClient):
3019         * workers/service/server/SWServer.h:
3020         * workers/service/server/SWServerToContextConnection.h:
3021         * workers/service/server/SWServerWorker.cpp:
3022         (WebCore::SWServerWorker::userAgent const):
3023         * workers/service/server/SWServerWorker.h:
3024
3025 2018-12-21  Youenn Fablet  <youenn@apple.com>
3026
3027         RTCRtpSender.setParameters() does set active parameter
3028         https://bugs.webkit.org/show_bug.cgi?id=192848
3029
3030         Reviewed by Eric Carlson.
3031
3032         Covered by updated test.
3033
3034         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
3035         (WebCore::updateRTCRtpSendParameters):
3036         The routine was updating the local value, not the out parameter.
3037
3038 2018-12-21  Eric Carlson  <eric.carlson@apple.com>
3039
3040         'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged
3041         https://bugs.webkit.org/show_bug.cgi?id=187896
3042         <rdar://problem/42681445>
3043
3044         Reviewed by Jer Noble.
3045
3046         No new tests, tested manually.
3047
3048         * platform/mediastream/mac/AVVideoCaptureSource.h:
3049         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3050         (WebCore::AVVideoCaptureSource::deviceDisconnected):
3051         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
3052         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
3053         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
3054         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
3055         (WebCore::deviceHasInputStreams):
3056         (WebCore::isValidCaptureDevice):
3057         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
3058         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
3059         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted.
3060         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
3061         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3062         (WebCore::CoreAudioSharedUnit::setCaptureDevice):
3063         (WebCore::CoreAudioSharedUnit::devicesChanged):
3064         (WebCore::CoreAudioSharedUnit::startProducingData):
3065         (WebCore::CoreAudioSharedUnit::startInternal):
3066         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
3067         (WebCore::CoreAudioSharedUnit::captureFailed):
3068         (WebCore::CoreAudioCaptureSourceFactory::devicesChanged):
3069         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
3070         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted.
3071         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3072
3073 2018-12-20  Ryosuke Niwa  <rniwa@webkit.org>
3074
3075         REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running
3076         TestWebKitAPI.QuickLook.LegacyQuickLookContent
3077         https://bugs.webkit.org/show_bug.cgi?id=192859
3078         <rdar://problem/46887237>
3079
3080         Reviewed by Antti Koivisto.
3081
3082         After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread
3083         is inside a delegate callback even when there is a ScriptDisallowedScope defined.
3084
3085         Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed()
3086         by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion.
3087
3088         Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent
3089
3090         * dom/ContainerNodeAlgorithms.cpp:
3091         (WebCore::notifyChildNodeInserted):
3092         (WebCore::notifyChildNodeRemoved):
3093         * dom/Document.cpp:
3094         (WebCore::Document::nodeChildrenWillBeRemoved):
3095         (WebCore::Document::nodeWillBeRemoved):
3096         * dom/ScriptDisallowedScope.h:
3097         (WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope):
3098         * html/HTMLFormElement.cpp:
3099         (WebCore:: const):
3100
3101 2018-12-21  Joseph Pecoraro  <pecoraro@apple.com>
3102
3103         Update status of some WebCore features in features.json
3104         https://bugs.webkit.org/show_bug.cgi?id=192998
3105
3106         Reviewed by Tim Horton.
3107
3108         * features.json:
3109         - Variation Fonts: Supported
3110         - Conic Gradients: Supported in Preview
3111         - Web Share: Supported in Preview
3112         - <datalist>: Supported in Preview
3113         - Intersection Observers: Supported in Preview
3114
3115 2018-12-21  Zalan Bujtas  <zalan@apple.com>
3116
3117         [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
3118         https://bugs.webkit.org/show_bug.cgi?id=192357
3119         <rdar://problem/42852260>
3120
3121         Reviewed by Simon Fraser.
3122
3123         Do not try to paint the file picker when painting is disabled.
3124
3125         * rendering/RenderFileUploadControl.cpp:
3126         (WebCore::RenderFileUploadControl::paintObject):
3127
3128 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
3129
3130         [WebAuthN] userPresence should always be true
3131         https://bugs.webkit.org/show_bug.cgi?id=192835
3132         <rdar://problem/46538788>
3133
3134         Reviewed by Brent Fulgham.
3135
3136         In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification.
3137         This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123.
3138         After discussing with other members of the working group, we decided to make userPresence always default to true.
3139
3140         Covered by exisiting tests.
3141
3142         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
3143         (fido::encodeGetAssertionRequestAsCBOR):
3144
3145 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
3146
3147         [WebAuthN] Import an APDU coder from Chromium
3148         https://bugs.webkit.org/show_bug.cgi?id=192949
3149         <rdar://problem/46879933>
3150
3151         Reviewed by Brent Fulgham.
3152
3153         This patch imports an APDU coder from Chromium. Here is the documentation:
3154         https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
3155         APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
3156
3157         Here is a list of files that are imported from Chromium:
3158         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
3159         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
3160         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
3161         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
3162         https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
3163
3164         Covered by API tests.
3165
3166         * Modules/webauthn/apdu/ApduCommand.cpp: Added.
3167         (apdu::ApduCommand::createFromMessage):
3168         (apdu::ApduCommand::ApduCommand):
3169         (apdu::ApduCommand::getEncodedCommand const):
3170         * Modules/webauthn/apdu/ApduCommand.h: Added.
3171         * Modules/webauthn/apdu/ApduResponse.cpp: Added.
3172         (apdu::ApduResponse::createFromMessage):
3173         (apdu::ApduResponse::ApduResponse):
3174         (apdu::ApduResponse::getEncodedResponse const):
3175         * Modules/webauthn/apdu/ApduResponse.h: Added.
3176         * Sources.txt:
3177         * WebCore.xcodeproj/project.pbxproj:
3178
3179 2018-12-21  Jer Noble  <jer.noble@apple.com>
3180
3181         Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC
3182         https://bugs.webkit.org/show_bug.cgi?id=192985
3183         <rdar://problem/46750743>
3184
3185         Reviewed by Eric Carlson.
3186
3187         Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr.
3188
3189         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
3190         (WebCore::WebKitMediaKeys::setMediaElement):
3191         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
3192         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
3193         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3194         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3195         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
3196         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
3197
3198 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
3199
3200         CSS variables don't work for colors in "border" property
3201         https://bugs.webkit.org/show_bug.cgi?id=192922
3202
3203         Reviewed by Simon Fraser.
3204
3205         ParseColorFunction no longer consumes anything if the color was not valid.
3206
3207         Test: css-custom-properties-api/border-variable-parsing.html
3208
3209         * css/parser/CSSPropertyParserHelpers.cpp:
3210         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
3211
3212 2018-12-21  Justin Fan  <justin_fan@apple.com>
3213
3214         [WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging
3215         https://bugs.webkit.org/show_bug.cgi?id=192990
3216
3217         Reviewed by Myles C. Maxfield.
3218
3219         Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation.
3220         Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions.
3221
3222         No new tests; no change in behavior.
3223
3224         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
3225         (WebCore::WebGPUBindGroupLayout::create):
3226         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
3227         * Modules/webgpu/WebGPUBindGroupLayout.h:
3228         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
3229         * Modules/webgpu/WebGPUDevice.cpp:
3230         (WebCore::WebGPUDevice::createBindGroupLayout const):
3231         * platform/graphics/gpu/GPUBindGroupLayout.h:
3232         * platform/graphics/gpu/GPUDevice.cpp:
3233         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr. 
3234         (WebCore::GPUDevice::createBindGroupLayout const): Deleted.
3235         * platform/graphics/gpu/GPUDevice.h:
3236         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
3237         (WebCore::appendArgumentToArray):
3238         (WebCore::newEncoder):
3239         (WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr.
3240         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
3241         (WebCore::appendArgumentToArrayInMap): Deleted.
3242         (WebCore::GPUBindGroupLayout::create): Deleted.
3243
3244         Deleted unneeded GPUBindGroupLayout.cpp:
3245         * Sources.txt:
3246         * WebCore.xcodeproj/project.pbxproj:
3247         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed.
3248
3249 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
3250
3251         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
3252         https://bugs.webkit.org/show_bug.cgi?id=190466
3253
3254         Reviewed by Youenn Fablet.
3255
3256         Added persistency to the DeviceIdHashSaltStorage.
3257
3258         * platform/glib/FileSystemGlib.cpp:
3259         (WebCore::FileSystem::getFileSize): Implemented this function to
3260         allow sharing code with the statistics storage class.
3261         * platform/glib/KeyedDecoderGlib.cpp:
3262         (WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a
3263         condition to control situations where the key is empty, it can
3264         happen if the user modifies the file in the disk.
3265         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include
3266         to make work compilation with debug, unified builds.
3267
3268 2018-12-21  Zalan Bujtas  <zalan@apple.com>
3269
3270         Synchronous media query evaluation could destroy current Frame/FrameView.
3271         https://bugs.webkit.org/show_bug.cgi?id=192781
3272         <rdar://problem/34416793>
3273
3274         Reviewed by Chris Dumez.
3275
3276         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
3277
3278         Test: printing/print-with-media-query-destory.html
3279
3280         * loader/DocumentLoader.cpp:
3281         (WebCore::DocumentLoader::finishedLoading):
3282         * page/Frame.cpp:
3283         (WebCore::Frame::setPrinting):
3284         * page/FrameView.cpp:
3285         (WebCore::FrameView::forceLayoutForPagination):
3286         * page/PrintContext.cpp:
3287         (WebCore::PrintContext::PrintContext):
3288         (WebCore::PrintContext::computePageRects):
3289         (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
3290         (WebCore::PrintContext::begin):
3291         (WebCore::PrintContext::computeAutomaticScaleFactor):
3292         (WebCore::PrintContext::spoolPage):
3293         (WebCore::PrintContext::spoolRect):
3294         (WebCore::PrintContext::end):
3295         * page/PrintContext.h:
3296         (WebCore::PrintContext::frame const): Deleted.
3297
3298 2018-12-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3299
3300         Setting the file wrapper and content type of an attachment to a PDF should update its image
3301         https://bugs.webkit.org/show_bug.cgi?id=192984
3302         <rdar://problem/46798028>
3303
3304         Reviewed by Tim Horton.
3305
3306         Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment.
3307         Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment.
3308
3309         * html/HTMLAttachmentElement.cpp:
3310         (WebCore::mimeTypeIsSuitableForInlineImageAttachment):
3311         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
3312
3313 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
3314
3315         Repeated background images with zero size should display the background color
3316         https://bugs.webkit.org/show_bug.cgi?id=192962
3317
3318         Reviewed by Antti Koivisto.
3319
3320         Test: fast/backgrounds/background-repeat-with-zero-size.html
3321
3322         * platform/LengthSize.h:
3323         (WebCore::LengthSize::isEmpty const):
3324         * rendering/RenderBoxModelObject.cpp:
3325         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3326         * rendering/style/FillLayer.h:
3327         (WebCore::FillLayer::isEmpty const):
3328
3329 2018-12-21  Manuel Rego Casasnovas  <rego@igalia.com>
3330
3331         [css-grid] Fix percentages in relative offsets for grid items
3332         https://bugs.webkit.org/show_bug.cgi?id=190492
3333
3334         Reviewed by Sergio Villar Senin.
3335
3336         The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items,
3337         where the containing block is the grid area.
3338         The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required.
3339
3340         Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
3341
3342         * rendering/RenderBox.cpp: Implement the physical versions of the already existent methods.
3343         (WebCore::RenderBox::overrideContainingBlockContentWidth const):
3344         (WebCore::RenderBox::overrideContainingBlockContentHeight const):
3345         (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
3346         (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
3347         * rendering/RenderBox.h:
3348         * rendering/RenderBoxModelObject.cpp:
3349         (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
3350         to take into account overrideContainingBlockContentWidth|Height for grid items.
3351         * rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
3352         that will be overridden in RenderBox.
3353         (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
3354         (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
3355         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
3356         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):
3357
3358 2018-12-20  Justin Fan  <justin_fan@apple.com>
3359
3360         [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders
3361         https://bugs.webkit.org/show_bug.cgi?id=192956
3362
3363         Reviewed by Myles Maxfield.
3364
3365         No testable behavior change. Existing tests cover possible crashing.
3366
3367         Add GPUBindGroupLayoutMetal.mm:
3368         * SourcesCocoa.txt:
3369         * WebCore.xcodeproj/project.pbxproj:
3370
3371         Flesh out GPUBindGroupLayout::create:
3372         * platform/graphics/gpu/GPUBindGroupLayout.cpp:
3373         * platform/graphics/gpu/GPUBindGroupLayout.h:
3374         * platform/graphics/gpu/GPUDevice.cpp:
3375         (WebCore::GPUDevice::createBindGroupLayout const):
3376         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added.
3377         (WebCore::appendArgumentToArrayInMap): Added.