[LFC] ComputedHorizontalMargin should have optional members
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-04  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC] ComputedHorizontalMargin should have optional members
4         https://bugs.webkit.org/show_bug.cgi?id=193131
5
6         Reviewed by Antti Koivisto.
7
8         Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional.
9         (see computed vs used values)
10
11         * layout/FormattingContext.h:
12         * layout/FormattingContextGeometry.cpp:
13         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
14         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
15         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
16         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
17         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
18         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
19         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted.
20         * layout/LayoutUnits.h:
21         * layout/MarginTypes.h:
22         * layout/Verification.cpp:
23         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
24         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
25         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
26         * layout/displaytree/DisplayBox.h:
27         (WebCore::Display::Box::setHorizontalMargin):
28         (WebCore::Display::Box::setHorizontalComputedMargin):
29         (WebCore::Display::Box::computedMarginStart const):
30         (WebCore::Display::Box::computedMarginEnd const):
31         * layout/floats/FloatAvoider.h:
32         (WebCore::Layout::FloatAvoider::marginStart const):
33         (WebCore::Layout::FloatAvoider::marginEnd const):
34         * layout/inlineformatting/InlineFormattingContext.cpp:
35         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
36         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
37         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
38
39 2019-01-04  Zalan Bujtas  <zalan@apple.com>
40
41         [LFC][BFC] Use computedValue and usedValue consistently
42         https://bugs.webkit.org/show_bug.cgi?id=193059
43
44         Reviewed by Antti Koivisto.
45
46         https://www.w3.org/TR/CSS22/cascade.html#value-stages
47
48         6.1.2 Computed values
49         Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units
50         are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document...
51
52         6.1.3 Used values
53         Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document
54         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
55         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
56         dependencies into an absolute value.
57
58         * layout/FormattingContext.cpp:
59         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
60         * layout/FormattingContextGeometry.cpp:
61         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
62         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
63         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
64         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
65         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
66         * layout/LayoutState.cpp:
67         (WebCore::Layout::LayoutState::LayoutState):
68         * layout/LayoutUnits.h:
69         * layout/Verification.cpp:
70         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
71         * layout/blockformatting/BlockFormattingContext.cpp:
72         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
73         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
74         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
75         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
76         * layout/displaytree/DisplayBox.cpp:
77         (WebCore::Display::Box::Box):
78         * layout/displaytree/DisplayBox.h:
79         (WebCore::Display::Box::setHasValidHorizontalComputedMargin):
80         (WebCore::Display::Box::setHorizontalComputedMargin):
81         (WebCore::Display::Box::computedMarginStart const):
82         (WebCore::Display::Box::computedMarginEnd const):
83         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted.
84         (WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted.
85         (WebCore::Display::Box::nonComputedMarginStart const): Deleted.
86         (WebCore::Display::Box::nonComputedMarginEnd const): Deleted.
87         * layout/floats/FloatAvoider.h:
88         (WebCore::Layout::FloatAvoider::marginStart const):
89         (WebCore::Layout::FloatAvoider::marginEnd const):
90         * layout/inlineformatting/InlineFormattingContext.cpp:
91         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
92
93 2019-01-03  Zalan Bujtas  <zalan@apple.com>
94
95         REGRESSION: -webkit-appearance test case crashes
96         https://bugs.webkit.org/show_bug.cgi?id=189302
97         <rdar://problem/44143049>
98
99         Reviewed by Wenson Hsieh.
100
101         The painting and the layout positions of the cancel button need to match in order to be able to interact with it.
102         This patch removes the previous position inlining attempts.
103
104         Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html
105
106         * rendering/RenderThemeMac.mm:
107         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
108
109 2019-01-03  David Kilzer  <ddkilzer@apple.com>
110
111         Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
112         <https://webkit.org/b/193122>
113         <rdar://problem/47022987>
114
115         Reviewed by Youenn Fablet.
116
117         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
118         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const):
119         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const):
120         - Remove `final` keyword so that
121           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
122           can be called.
123         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
124         - To fix the leak call
125           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
126           to create the object.
127
128 2019-01-03  Simon Fraser  <simon.fraser@apple.com>
129
130         REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset)
131         https://bugs.webkit.org/show_bug.cgi?id=193124
132         rdar://problem/46755409
133
134         Reviewed by Tim Horton.
135
136         Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger
137         an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry().
138         So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code
139         path that runs when top content inset changes.
140
141         Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression.
142
143         * rendering/RenderLayerCompositor.cpp:
144         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
145
146 2019-01-03  Chris Dumez  <cdumez@apple.com>
147
148         Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
149         https://bugs.webkit.org/show_bug.cgi?id=192997
150         <rdar://problem/46217271>
151
152         Reviewed by Antti Koivisto.
153
154         isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers.
155         The issue is that a Frame can be its opener. There could also be a cycle in the opener chain.
156
157         To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now
158         only check if the frames belong to the same pages or if their openers do. We no longer check
159         openers' opener and up.
160
161         Note that this function is used to check if a frame is allowed to target another. In practice,
162         it is unlikely to be useful to navigate an opener's opener and an openee's openee.
163
164         Tests: fast/dom/Window/window-open-opener-cycle.html
165                fast/dom/Window/window-open-self-as-opener.html
166
167         * page/FrameTree.cpp:
168         (WebCore::isFrameFamiliarWith):
169
170 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
171
172         REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
173         https://bugs.webkit.org/show_bug.cgi?id=193095
174         <rdar://problem/47014944>
175
176         Reviewed by Zalan Bujtas.
177         
178         In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
179         and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
180         which continues to affect the appearance of text.
181         
182         Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
183
184         Test: compositing/contents-format/subpixel-antialiased-text.html
185
186         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
187         (WebCore::PlatformCALayer::drawLayerContents):
188
189 2019-01-02  David Kilzer  <ddkilzer@apple.com>
190
191         Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
192         <https://webkit.org/b/193016>
193         <rdar://problem/46925703>
194
195         Reviewed by Simon Fraser.
196
197         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
198         (WebCore::copySampleBufferWithCurrentTimeStamp):
199         - Change to return RetainPtr<CMSampleBufferRef>.
200         - Check return value of CMSampleBufferCreateCopyWithNewTiming().
201         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
202         - Check return value of copySampleBufferWithCurrentTimeStamp().
203         - Fix leak by using RetainPtr<CMSampleBufferRef> returned from
204           copySampleBufferWithCurrentTimeStamp() instead of leaking
205           `bufferWithCurrentTime` by using retainPtr().
206         (WebCore::createAudioFormatDescription):
207         - Extract method from appendAudioSampleBuffer() to return
208           RetainPtr<CMFormatDescriptionRef> after calling
209           CMAudioFormatDescriptionCreate().
210         - Check return value of CMAudioFormatDescriptionCreate().
211         (WebCore::createAudioSampleBufferWithPacketDescriptions):
212         - Extract method from appendAudioSampleBuffer() to return
213           RetainPtr<CMSampleBufferRef> after calling
214           CMAudioSampleBufferCreateWithPacketDescriptions().
215         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
216         - Check return values of createAudioFormatDescription() and
217           createAudioSampleBufferWithPacketDescriptions().
218         - Fix leaks by extracting code into helper methods that return
219           RetainPtr<> objects instead of leaking CMFormatDescriptionRef
220           directly or leaking `sampleBuffer` by using retainPtr().
221
222 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
223
224         Add support for using the current text selection as the find string on iOS
225         https://bugs.webkit.org/show_bug.cgi?id=193034
226         <rdar://problem/45138739>
227
228         Reviewed by Tim Horton.
229
230         Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
231         pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
232         process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
233         able to trigger find-in-page with this string.
234
235         Test: WebKit.UseSelectionAsFindString
236
237         * editing/Editor.cpp:
238         (WebCore::Editor::canCopyExcludingStandaloneImages const):
239
240         Make this helper function cross-platform.
241
242         * editing/Editor.h:
243         * editing/EditorCommand.cpp:
244         (WebCore::createCommandMap):
245         * editing/cocoa/EditorCocoa.mm:
246         (WebCore::Editor::takeFindStringFromSelection):
247
248         Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
249         find string (see WebKit/ChangeLog for more details).
250
251         * editing/mac/EditorMac.mm:
252         (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
253         (WebCore::Editor::takeFindStringFromSelection): Deleted.
254         * loader/EmptyClients.cpp:
255         * page/EditorClient.h:
256
257         Add a new editor client method to send the string for find-in-page to the UI process.
258
259 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
260
261         Web Inspector: Implement `queryObjects` Command Line API
262         https://bugs.webkit.org/show_bug.cgi?id=176766
263         <rdar://problem/34890689>
264
265         Reviewed by Joseph Pecoraro.
266
267         Test: inspector/console/queryObjects.html
268
269         * inspector/CommandLineAPIModuleSource.js:
270         (CommandLineAPI):
271         (CommandLineAPIImpl.prototype.queryObjects): Added.
272
273 2019-01-02  Charles Vazac  <cvazac@gmail.com>
274
275         Fix resourcetimingbufferfull bubbles attribute
276         https://bugs.webkit.org/show_bug.cgi?id=193087
277
278         Reviewed by Chris Dumez.
279
280         This change is covered by web-platform-tests [1].
281
282         [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
283
284         * page/Performance.cpp:
285         (WebCore::Performance::resourceTimingBufferFullTimerFired):
286
287 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
288
289         Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
290         https://bugs.webkit.org/show_bug.cgi?id=193010
291
292         Reviewed by Zalan Bujtas.
293
294         Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
295         and make it an enum class.
296
297         * page/FrameView.cpp:
298         (WebCore::FrameView::scrollLayerID const):
299         * rendering/RenderLayer.h:
300         * rendering/RenderLayerBacking.cpp:
301         (WebCore::RenderLayerBacking::~RenderLayerBacking):
302         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
303         (WebCore::operator<<):
304         * rendering/RenderLayerBacking.h:
305         * rendering/RenderLayerCompositor.cpp:
306         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
307         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
308         (WebCore::scrollCoordinationRoleForNodeType):
309         (WebCore::RenderLayerCompositor::attachScrollingNode):
310         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
311         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
312         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
313         * rendering/RenderLayerCompositor.h:
314
315 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
316
317         Don't spin up a CalcParser if the current token is not a function token
318         https://bugs.webkit.org/show_bug.cgi?id=193067
319
320         Reviewed by Zalan Bujtas.
321
322         Various functions in CSSPropertyParserHelpers fall back to trying to parse
323         a calc expression if the normal parsing fails. Don't do this unless the
324         current token is a function token, which should be slightly more efficient.
325
326         * css/parser/CSSPropertyParserHelpers.cpp:
327         (WebCore::CSSPropertyParserHelpers::consumeInteger):
328         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
329         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
330         (WebCore::CSSPropertyParserHelpers::consumeNumber):
331         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
332         (WebCore::CSSPropertyParserHelpers::consumeLength):
333         (WebCore::CSSPropertyParserHelpers::consumePercent):
334         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
335         (WebCore::CSSPropertyParserHelpers::consumeAngle):
336         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
337         (WebCore::CSSPropertyParserHelpers::consumeTime):
338
339 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
340
341         Support css-color-4 rgb functions
342         https://bugs.webkit.org/show_bug.cgi?id=192321
343
344         Reviewed by Zalan Bujtas.
345         
346         Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
347         The differences are:
348         1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
349             rgb(128 34 56)
350             rgb(128 34 56 / 50%)
351         2. Floating point values are allowed, and rounded:
352             rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
353         3. rgba() is a pure alias for rgb(), so these are equivalent:
354             rgb(128 34 56 / 50%)
355             rgba(128 34 56 / 50%)
356             
357         hsl()/hsla() parsing was already updated to this new syntax in r230861.
358
359         Tested by tests in imported/w3c/web-platform-tests/css/css-color/
360
361         * css/parser/CSSPropertyParserHelpers.cpp:
362         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
363         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
364         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
365
366 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
367
368         Handle calc() expressions in gradient color stops
369         https://bugs.webkit.org/show_bug.cgi?id=193066
370         rdar://problem/46961985
371
372         Reviewed by Sam Weinig.
373         
374         Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
375         for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
376         calc values as well as angle ones.
377
378         Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
379         just as isPx() etc do.
380
381         Test: fast/gradients/conic-calc-stop-position.html
382
383         * css/CSSPrimitiveValue.h:
384         (WebCore::CSSPrimitiveValue::isAngle const):
385         * css/parser/CSSPropertyParserHelpers.cpp:
386         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
387         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
388
389 2018-12-31  Keith Miller  <keith_miller@apple.com>
390
391         SourceProviders should use an actual URL instead of a string
392         https://bugs.webkit.org/show_bug.cgi?id=192734
393
394         Reviewed by Yusuke Suzuki.
395
396         Remove ScriptSourceCode's URL member and make the url() method
397         reference the URL on the SourceProvider. Also, avoid some
398         ref count churn.
399
400         Additionally, this patch fixes an existing bug in
401         WorkletGlobalScope() that would use a ScriptSourceCode after
402         WTFMoving it.
403
404         * bindings/js/CachedScriptSourceProvider.h:
405         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
406         * bindings/js/ScheduledAction.cpp:
407         (WebCore::ScheduledAction::execute):
408         * bindings/js/ScriptController.cpp:
409         (WebCore::ScriptController::executeScriptInWorld):
410         (WebCore::ScriptController::executeScript):
411         * bindings/js/ScriptSourceCode.h:
412         (WebCore::ScriptSourceCode::ScriptSourceCode):
413         (WebCore::ScriptSourceCode::m_code):
414         (WebCore::ScriptSourceCode::url const):
415         (WebCore::ScriptSourceCode::m_url): Deleted.
416         * dom/ScriptElement.cpp:
417         (WebCore::ScriptElement::prepareScript):
418         (WebCore::ScriptElement::requestModuleScript):
419         (WebCore::ScriptElement::executePendingScript):
420         * html/HTMLMediaElement.cpp:
421         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
422         * page/Frame.cpp:
423         (WebCore::Frame::injectUserScriptImmediately):
424         * workers/WorkerGlobalScope.cpp:
425         (WebCore::WorkerGlobalScope::importScripts):
426         * workers/WorkerThread.cpp:
427         (WebCore::WorkerThread::workerThread):
428         * worklets/WorkletGlobalScope.cpp:
429         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
430         * xml/parser/XMLDocumentParserLibxml2.cpp:
431         (WebCore::XMLDocumentParser::endElementNs):
432
433 2019-01-01  Jeff Miller  <jeffm@apple.com>
434
435         Update user-visible copyright strings to include 2019
436         https://bugs.webkit.org/show_bug.cgi?id=192811
437
438         Reviewed by Mark Lam.
439
440         * Info.plist:
441
442 2018-12-30  David Kilzer  <ddkilzer@apple.com>
443
444         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
445         <https://webkit.org/b/193058>
446         <rdar://problem/46979275>
447
448         Reviewed by Yusuke Suzuki.
449
450         * rendering/BorderEdge.cpp:
451         (WebCore::BorderEdge::BorderEdge): Reorder initialization to
452         match new instance variable order.
453         * rendering/BorderEdge.h: Reorder instance variables to save
454         8 padding bytes.
455
456 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
457
458         [JSC] Remove one indirection in JSObject::toStringName
459         https://bugs.webkit.org/show_bug.cgi?id=193037
460
461         Reviewed by Keith Miller.
462
463         Use old JSObject::toStringName function here.
464
465         * bindings/js/JSDOMConstructorBase.cpp:
466         (WebCore::JSDOMConstructorBase::className):
467         (WebCore::JSDOMConstructorBase::toStringName):
468         * bindings/js/JSDOMConstructorBase.h:
469         (WebCore::JSDOMConstructorBase::className): Deleted.
470
471 2018-12-27  Alex Christensen  <achristensen@webkit.org>
472
473         Resurrect Mac CMake build
474         https://bugs.webkit.org/show_bug.cgi?id=192658
475
476         Reviewed by Yusuke Suzuki.
477
478         This makes it so JSC and most of WebCore builds.
479         WebCore's use of ARC seems inconsistent, so I'll fix that later.
480
481         * PlatformMac.cmake:
482         * config.h:
483
484 2018-12-26  Jim Mason  <jmason@ibinx.com>
485
486         [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
487         https://bugs.webkit.org/show_bug.cgi?id=193036
488
489         Reviewed by Michael Catanzaro.
490
491         * platform/graphics/FontPlatformData.h:
492         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
493
494 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
495
496         Remove "using namespace std;"
497         https://bugs.webkit.org/show_bug.cgi?id=192973
498         <rdar://problem/46937309>
499
500         Unreviewed Windows port Debug builds fix.
501
502         No new tests since no behavior changes.
503
504         * accessibility/win/AXObjectCacheWin.cpp:
505         (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
506
507 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
508
509         Remove "using namespace std;"
510         https://bugs.webkit.org/show_bug.cgi?id=192973
511
512         Reviewed by Alex Christensen.
513
514         Removed "using namespace std" statement, and use std:: prefix.
515
516         No new tests since no behavior changes.
517
518         * accessibility/win/AXObjectCacheWin.cpp:
519         * platform/graphics/GraphicsContext3DPrivate.cpp:
520         * platform/graphics/cairo/ImageBufferCairo.cpp:
521         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
522         * platform/graphics/win/FontWin.cpp:
523         (WebCore::FontCascade::floatWidthForComplexText const):
524         * platform/graphics/win/GraphicsContextCGWin.cpp:
525         * platform/graphics/win/GraphicsContextCairoWin.cpp:
526         * platform/graphics/win/GraphicsContextDirect2D.cpp:
527         * platform/graphics/win/GraphicsContextWin.cpp:
528         * platform/graphics/win/SimpleFontDataCGWin.cpp:
529         * platform/graphics/win/UniscribeController.cpp:
530         (WebCore::UniscribeController::UniscribeController):
531         (WebCore::UniscribeController::shapeAndPlaceItem):
532         * platform/image-decoders/ScalableImageDecoder.cpp:
533         * platform/text/LocaleICU.cpp:
534         * platform/text/win/LocaleWin.cpp:
535         * platform/win/ScrollbarThemeWin.cpp:
536         * rendering/RenderRubyRun.cpp:
537         (WebCore::RenderRubyRun::layoutBlock):
538         * rendering/RenderThemeWin.cpp:
539         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
540         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
541         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
542         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
543         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
544         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
545         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
546
547 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
548
549         Change ScrollingNodeType to an enum class
550         https://bugs.webkit.org/show_bug.cgi?id=193009
551
552         Reviewed by Zalan Bujtas.
553
554         Change the ScrollingNodeType enum to an enum class.
555         
556         No behavior change.
557
558         * page/scrolling/AsyncScrollingCoordinator.cpp:
559         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
560         * page/scrolling/ScrollingCoordinator.cpp:
561         (WebCore::operator<<):
562         * page/scrolling/ScrollingCoordinator.h:
563         * page/scrolling/ScrollingStateFixedNode.cpp:
564         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
565         * page/scrolling/ScrollingStateNode.h:
566         (WebCore::ScrollingStateNode::isFixedNode const):
567         (WebCore::ScrollingStateNode::isStickyNode const):
568         (WebCore::ScrollingStateNode::isFrameScrollingNode const):
569         (WebCore::ScrollingStateNode::isOverflowScrollingNode const):
570         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
571         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
572         * page/scrolling/ScrollingStateStickyNode.cpp:
573         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
574         * page/scrolling/ScrollingStateTree.cpp:
575         (WebCore::ScrollingStateTree::createNode):
576         (WebCore::ScrollingStateTree::attachNode):
577         * page/scrolling/ScrollingTreeNode.h:
578         (WebCore::ScrollingTreeNode::isFixedNode const):
579         (WebCore::ScrollingTreeNode::isStickyNode const):
580         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
581         (WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
582         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
583         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
584         * page/scrolling/ios/ScrollingTreeIOS.cpp:
585         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
586         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
587         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
588         * page/scrolling/mac/ScrollingTreeMac.cpp:
589         (ScrollingTreeMac::createScrollingTreeNode):
590         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
591         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
592         * platform/graphics/GraphicsLayerClient.h:
593         * rendering/RenderLayerCompositor.cpp:
594         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
595         (WebCore::scrollCoordinationRoleForNodeType):
596         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
597         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
598
599 2018-12-22  Carlos Garcia Campos  <cgarcia@igalia.com>
600
601         [HarfBuzz] Width not correctly reported as 0 for zero font size
602         https://bugs.webkit.org/show_bug.cgi?id=192986
603
604         Reviewed by Michael Catanzaro.
605
606         Fixes test fast/text/font-size-zero.html
607
608         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
609         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
610         size is zero.
611
612 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
613
614         Use Ref<> as much as possible
615         https://bugs.webkit.org/show_bug.cgi?id=192808
616
617         Reviewed by Alex Christensen.
618
619         * Modules/encryptedmedia/NavigatorEME.cpp:
620         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
621         * Modules/fetch/FetchBody.cpp:
622         (WebCore::FetchBody::bodyAsFormData const):
623         * Modules/geolocation/Geolocation.cpp:
624         (WebCore::Geolocation::getCurrentPosition):
625         (WebCore::Geolocation::watchPosition):
626         * Modules/indexeddb/IDBDatabase.cpp:
627         (WebCore::IDBDatabase::objectStoreNames const):
628         * Modules/indexeddb/IDBDatabase.h:
629         * Modules/indexeddb/IDBObjectStore.cpp:
630         (WebCore::IDBObjectStore::indexNames const):
631         * Modules/indexeddb/IDBObjectStore.h:
632         * Modules/indexeddb/IDBTransaction.cpp:
633         (WebCore::IDBTransaction::scheduleOperation):
634         * Modules/indexeddb/IDBTransaction.h:
635         * Modules/indexeddb/client/TransactionOperation.h:
636         (WebCore::IDBClient::createTransactionOperation):
637         * Modules/mediastream/MediaDevices.cpp:
638         (WebCore::MediaDevices::getUserMedia const):
639         (WebCore::MediaDevices::getDisplayMedia const):
640         * Modules/mediastream/UserMediaRequest.cpp:
641         (WebCore::UserMediaRequest::create):
642         * Modules/mediastream/UserMediaRequest.h:
643         * Modules/webaudio/AudioParam.cpp:
644         (WebCore::AudioParam::calculateFinalValues):
645         * Modules/webaudio/ScriptProcessorNode.cpp:
646         (WebCore::ScriptProcessorNode::initialize):
647         * Modules/webdatabase/SQLStatement.cpp:
648         (WebCore::SQLStatement::execute):
649         * Modules/webgpu/WebGPU.cpp:
650         (WebCore::WebGPU::requestAdapter const):
651         * Modules/webgpu/WebGPUAdapter.cpp:
652         (WebCore::WebGPUAdapter::create):
653         * Modules/webgpu/WebGPUAdapter.h:
654         * Modules/webgpu/WebGPUBuffer.cpp:
655         (WebCore::WebGPUBuffer::create):
656         * Modules/webgpu/WebGPUBuffer.h:
657         * Modules/webgpu/WebGPUCommandBuffer.cpp:
658         (WebCore::WebGPUCommandBuffer::create):
659         (WebCore::WebGPUCommandBuffer::beginRenderPass):
660         * Modules/webgpu/WebGPUCommandBuffer.h:
661         * Modules/webgpu/WebGPUDevice.cpp:
662         (WebCore::WebGPUDevice::create):
663         (WebCore::WebGPUDevice::createBuffer const):
664         (WebCore::WebGPUDevice::createShaderModule const):
665         (WebCore::WebGPUDevice::createRenderPipeline const):
666         (WebCore::WebGPUDevice::createCommandBuffer const):
667         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
668         (WebCore::WebGPURenderPassEncoder::create):
669         * Modules/webgpu/WebGPURenderPassEncoder.h:
670         * Modules/webgpu/WebGPURenderPipeline.cpp:
671         (WebCore::WebGPURenderPipeline::create):
672         * Modules/webgpu/WebGPURenderPipeline.h:
673         * Modules/webgpu/WebGPUShaderModule.cpp:
674         (WebCore::WebGPUShaderModule::create):
675         * Modules/webgpu/WebGPUShaderModule.h:
676         * Modules/webgpu/WebGPUTexture.cpp:
677         (WebCore::WebGPUTexture::createDefaultTextureView):
678         * Modules/webgpu/WebGPUTextureView.cpp:
679         (WebCore::WebGPUTextureView::create):
680         * Modules/webgpu/WebGPUTextureView.h:
681         * accessibility/AXObjectCache.cpp:
682         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
683         * accessibility/atk/AXObjectCacheAtk.cpp:
684         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
685         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
686         (webkitAccessibleHyperlinkGetStartIndex):
687         (webkitAccessibleHyperlinkGetEndIndex):
688         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
689         (getSelectionOffsetsForObject):
690         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
691         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
692         * bindings/js/JSDOMGlobalObjectTask.cpp:
693         * bindings/js/JSDOMWindowBase.cpp:
694         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
695         * bindings/js/JSWorkerGlobalScopeBase.cpp:
696         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
697         * bindings/js/ScriptControllerMac.mm:
698         (WebCore::ScriptController::createScriptInstanceForWidget):
699         * bindings/js/SerializedScriptValue.cpp:
700         (WebCore::CloneDeserializer::readTerminal):
701         (WebCore::SerializedScriptValue::create):
702         * bridge/objc/objc_instance.h:
703         * bridge/objc/objc_instance.mm:
704         (ObjcInstance::create):
705         * css/CSSComputedStyleDeclaration.cpp:
706         (WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
707         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
708         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
709         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
710         * css/CSSComputedStyleDeclaration.h:
711         * css/CSSFontFaceSource.cpp:
712         (WebCore::CSSFontFaceSource::load):
713         * css/CSSStyleSheet.cpp:
714         (WebCore::CSSStyleSheet::rules):
715         * css/FontFace.cpp:
716         (WebCore::FontFace::unicodeRange const):
717         (WebCore::FontFace::featureSettings const):
718         * css/InspectorCSSOMWrappers.cpp:
719         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
720         * css/SVGCSSComputedStyleDeclaration.cpp:
721         (WebCore::strokeDashArrayToCSSValueList):
722         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
723         * css/StyleResolver.cpp:
724         (WebCore::StyleResolver::createFilterOperations):
725         * css/StyleRule.cpp:
726         (WebCore::StyleRuleBase::createCSSOMWrapper const):
727         * css/StyleRule.h:
728         * dom/ChildListMutationScope.cpp:
729         (WebCore::ChildListMutationAccumulator::getOrCreate):
730         * dom/ChildListMutationScope.h:
731         * dom/DocumentMarkerController.cpp:
732         (WebCore::updateRenderedRectsForMarker):
733         * dom/InlineStyleSheetOwner.cpp:
734         (WebCore::InlineStyleSheetOwner::createSheet):
735         * dom/PointerEvent.h:
736         * dom/UserGestureIndicator.h:
737         (WebCore::UserGestureToken::create):
738         * editing/AlternativeTextController.cpp:
739         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
740         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
741         (WebCore::AlternativeTextController::respondToUnappliedEditing):
742         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
743         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
744         * editing/ApplyStyleCommand.cpp:
745         (WebCore::ApplyStyleCommand::applyBlockStyle):
746         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
747         * editing/CompositeEditCommand.cpp:
748         (WebCore::CompositeEditCommand::targetRanges const):
749         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
750         (WebCore::CompositeEditCommand::moveParagraphs):
751         * editing/DeleteSelectionCommand.cpp:
752         (WebCore::DeleteSelectionCommand::mergeParagraphs):
753         * editing/Editing.cpp:
754         (WebCore::visiblePositionForIndexUsingCharacterIterator):
755         * editing/EditingStyle.cpp:
756         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
757         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
758         (WebCore::EditingStyle::prepareToApplyAt):
759         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
760         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
761         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
762         (WebCore::extractPropertiesNotIn):
763         * editing/Editor.cpp:
764         (WebCore::Editor::setBaseWritingDirection):
765         (WebCore::Editor::setComposition):
766         * editing/EditorCommand.cpp:
767         (WebCore::executeApplyParagraphStyle):
768         (WebCore::executeMakeTextWritingDirectionLeftToRight):
769         (WebCore::executeMakeTextWritingDirectionNatural):
770         (WebCore::executeMakeTextWritingDirectionRightToLeft):
771         * editing/FormatBlockCommand.cpp:
772         (WebCore::FormatBlockCommand::formatRange):
773         * editing/RemoveFormatCommand.cpp:
774         (WebCore::RemoveFormatCommand::doApply):
775         * editing/ReplaceRangeWithTextCommand.cpp:
776         (WebCore::ReplaceRangeWithTextCommand::targetRanges const):
777         * editing/ReplaceSelectionCommand.cpp:
778         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
779         (WebCore::handleStyleSpansBeforeInsertion):
780         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
781         * editing/SpellingCorrectionCommand.cpp:
782         (WebCore::SpellingCorrectionCommand::targetRanges const):
783         * editing/TextCheckingHelper.cpp:
784         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
785         * editing/TypingCommand.cpp:
786         (WebCore::TypingCommand::insertText):
787         (WebCore::TypingCommand::willAddTypingToOpenCommand):
788         * editing/VisibleUnits.cpp:
789         (WebCore::distanceBetweenPositions):
790         * editing/cocoa/EditorCocoa.mm:
791         (WebCore::Editor::selectionInWebArchiveFormat):
792         * editing/ios/DictationCommandIOS.cpp:
793         (WebCore::DictationCommandIOS::doApply):
794         * editing/ios/EditorIOS.mm:
795         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
796         (WebCore::Editor::removeUnchangeableStyles):
797         (WebCore::Editor::writeImageToPasteboard):
798         * editing/mac/EditorMac.mm:
799         (WebCore::Editor::replaceNodeFromPasteboard):
800         (WebCore::Editor::imageInWebArchiveFormat):
801         * editing/markup.cpp:
802         (WebCore::styleFromMatchedRulesAndInlineDecl):
803         (WebCore::createFragmentForTransformToFragment):
804         * fileapi/FileReaderLoader.cpp:
805         (WebCore::FileReaderLoader::didFinishLoading):
806         * html/FTPDirectoryDocument.cpp:
807         (WebCore::createTemplateDocumentData):
808         * html/HTMLMediaElement.cpp:
809         (WebCore::HTMLMediaElement::scheduleEvent):
810         (WebCore::HTMLMediaElement::createMediaControls):
811         * html/HTMLTableElement.cpp:
812         (WebCore::HTMLTableElement::createSharedCellStyle):
813         * html/HTMLTableElement.h:
814         * html/URLUtils.h:
815         (WebCore::URLUtils<T>::origin const):
816         * html/parser/HTMLConstructionSite.cpp:
817         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
818         * html/shadow/TextControlInnerElements.cpp:
819         (WebCore::TextControlInnerElement::resolveCustomStyle):
820         * html/track/WebVTTParser.cpp:
821         (WebCore::WebVTTParser::createNewCue):
822         * inspector/DOMPatchSupport.cpp:
823         * inspector/InspectorCanvas.cpp:
824         (WebCore::InspectorCanvas::buildInitialState):
825         (WebCore::InspectorCanvas::buildAction):
826         * inspector/InspectorFrontendClientLocal.cpp:
827         (WebCore::InspectorFrontendClientLocal::openInNewTab):
828         * inspector/InspectorStyleSheet.cpp:
829         (WebCore::asCSSRuleList):
830         (WebCore::InspectorStyle::styleWithProperties const):
831         (WebCore::InspectorStyleSheet::ensureSourceData):
832         * inspector/agents/InspectorCanvasAgent.cpp:
833         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
834         * inspector/agents/InspectorIndexedDBAgent.cpp:
835         (WebCore::Inspector::keyPathFromIDBKeyPath):
836         * inspector/agents/InspectorPageAgent.cpp:
837         (WebCore::InspectorPageAgent::archive):
838         * loader/EmptyClients.cpp:
839         (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace):
840         (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace):
841         (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
842         (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace):
843         * loader/FrameLoader.cpp:
844         (WebCore::FrameLoader::loadURL):
845         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
846         (WebCore::FrameLoader::loadDifferentDocumentItem):
847         * loader/WorkerThreadableLoader.cpp:
848         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
849         * loader/archive/mhtml/MHTMLParser.cpp:
850         (WebCore::MHTMLParser::addResourceToArchive):
851         (WebCore::MHTMLParser::parseNextPart):
852         * loader/cache/MemoryCache.cpp:
853         (WebCore::MemoryCache::addImageToCache):
854         (WebCore::MemoryCache::removeResourcesWithOrigin):
855         * page/DOMWindow.cpp:
856         (WebCore::DOMWindow::getMatchedCSSRules const):
857         (WebCore::DOMWindow::createWindow):
858         * page/EventHandler.cpp:
859         (WebCore::textDistance):
860         * page/Page.cpp:
861         (WebCore::Page::userStyleSheet const):
862         * page/animation/CSSPropertyAnimation.cpp:
863         (WebCore::blendFilterOperations):
864         * page/ios/FrameIOS.mm:
865         (WebCore::Frame::initWithSimpleHTMLDocument):
866         (WebCore::Frame::interpretationsForCurrentRoot const):
867         * page/mac/ServicesOverlayController.mm:
868         (WebCore::ServicesOverlayController::Highlight::fadeIn):
869         (WebCore::ServicesOverlayController::Highlight::fadeOut):
870         * platform/SharedBuffer.cpp:
871         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
872         * platform/audio/HRTFElevation.cpp:
873         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
874         * platform/audio/SincResampler.cpp:
875         (WebCore::SincResampler::consumeSource):
876         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
877         (WebCore::AudioFileReader::createBus):
878         * platform/audio/mac/AudioFileReaderMac.cpp:
879         (WebCore::AudioFileReader::createBus):
880         * platform/graphics/Icon.h:
881         (WebCore::Icon::create):
882         * platform/graphics/InbandTextTrackPrivate.h:
883         (WebCore::InbandTextTrackPrivate::create):
884         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
885         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
886         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
887         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
888         (WebCore::fulfillRequestWithKeyData):
889         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
890         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
891         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
892         (WebCore::MediaSourcePrivateAVFObjC::create):
893         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
894         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
895         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
896         (WebCore::SourceBufferPrivateAVFObjC::create):
897         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
898         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
899         * platform/graphics/ca/TileController.cpp:
900         (WebCore::TileController::createTileLayer):
901         * platform/graphics/ca/TileController.h:
902         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
903         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
904         (WebCore::CACFLayerTreeHost::create):
905         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
906         (WebCore::GPUBuffer::create):
907         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
908         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
909         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
910         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
911         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
912         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
913         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
914         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
915         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
916         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
917         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
918         (WebCore::AppendPipeline::appsinkNewSample):
919         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
920         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
921         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
922         (WebCore::ISOTrackEncryptionBox::parse):
923         * platform/graphics/texmap/TextureMapperAnimation.cpp:
924         (WebCore::applyFilterAnimation):
925         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
926         (WebCore::TextureMapperPlatformLayerBuffer::clone):
927         * platform/graphics/transforms/TransformOperations.cpp:
928         (WebCore::TransformOperations::blendByMatchingOperations const):
929         * platform/image-decoders/ico/ICOImageDecoder.cpp:
930         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
931         * platform/mock/mediasource/MockBox.cpp:
932         (WebCore::MockInitializationBox::MockInitializationBox):
933         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
934         (WebCore::MockSourceBufferPrivate::create):
935         (WebCore::MockSourceBufferPrivate::append):
936         * platform/mock/mediasource/MockSourceBufferPrivate.h:
937         * platform/mock/mediasource/MockTracks.h:
938         (WebCore::MockTextTrackPrivate::create):
939         (WebCore::MockVideoTrackPrivate::create):
940         * platform/network/FormData.h:
941         (WebCore::FormData::decode):
942         * platform/network/cocoa/CookieStorageObserver.h:
943         * platform/network/cocoa/CookieStorageObserver.mm:
944         (WebCore::CookieStorageObserver::create):
945         * platform/network/soup/ResourceRequestSoup.cpp:
946         (WebCore::appendEncodedBlobItemToSoupMessageBody):
947         (WebCore::ResourceRequest::updateSoupMessageBody const):
948         * platform/text/hyphen/HyphenationLibHyphen.cpp:
949         (WebCore::HyphenationDictionary::createNull):
950         (WebCore::HyphenationDictionary::create):
951         * platform/win/SearchPopupMenuWin.cpp:
952         (WebCore::SearchPopupMenuWin::SearchPopupMenuWin):
953         (WebCore::SearchPopupMenuWin::popupMenu):
954         * platform/win/SearchPopupMenuWin.h:
955         * rendering/RenderThemeIOS.mm:
956         (WebCore::applyCommonButtonPaddingToStyle):
957         (WebCore::RenderThemeIOS::paintProgressBar):
958         (WebCore::RenderThemeIOS::adjustButtonStyle const):
959         (WebCore::paintAttachmentIcon):
960         * rendering/svg/SVGRenderTreeAsText.cpp:
961         (WebCore::writeSVGResourceContainer):
962         * storage/Storage.cpp:
963         (WebCore::Storage::create):
964         (WebCore::Storage::Storage):
965         * storage/Storage.h:
966         (WebCore::Storage::area const):
967         * storage/StorageNamespace.h:
968         * storage/StorageNamespaceProvider.cpp:
969         (WebCore::StorageNamespaceProvider::localStorageArea):
970         * storage/StorageNamespaceProvider.h:
971         * svg/SVGElement.cpp:
972         (WebCore::SVGElement::getPresentationAttribute):
973         * svg/SVGFEBlendElement.cpp:
974         (WebCore::SVGFEBlendElement::build):
975         * svg/SVGFEColorMatrixElement.cpp:
976         (WebCore::SVGFEColorMatrixElement::build):
977         * svg/SVGFEComponentTransferElement.cpp:
978         (WebCore::SVGFEComponentTransferElement::build):
979         * svg/SVGFECompositeElement.cpp:
980         (WebCore::SVGFECompositeElement::build):
981         * svg/SVGFEDiffuseLightingElement.cpp:
982         (WebCore::SVGFEDiffuseLightingElement::build):
983         * svg/SVGFEDisplacementMapElement.cpp:
984         (WebCore::SVGFEDisplacementMapElement::build):
985         * svg/SVGFEDropShadowElement.cpp:
986         (WebCore::SVGFEDropShadowElement::build):
987         * svg/SVGFEGaussianBlurElement.cpp:
988         (WebCore::SVGFEGaussianBlurElement::build):
989         * svg/SVGFEMergeElement.cpp:
990         (WebCore::SVGFEMergeElement::build):
991         * svg/SVGFEMorphologyElement.cpp:
992         (WebCore::SVGFEMorphologyElement::build):
993         * svg/SVGFEOffsetElement.cpp:
994         (WebCore::SVGFEOffsetElement::build):
995         * svg/SVGFESpecularLightingElement.cpp:
996         (WebCore::SVGFESpecularLightingElement::build):
997         * svg/SVGFETileElement.cpp:
998         (WebCore::SVGFETileElement::build):
999         * testing/GCObservation.h:
1000         * xml/XSLTProcessor.cpp:
1001         (WebCore::XSLTProcessor::createDocumentFromSource):
1002         * xml/parser/XMLDocumentParser.cpp:
1003         (WebCore::XMLDocumentParser::parseDocumentFragment):
1004
1005 2018-12-21  Chris Dumez  <cdumez@apple.com>
1006
1007         navigator.userAgent in service workers does not reflect customUserAgent set by client
1008         https://bugs.webkit.org/show_bug.cgi?id=192951
1009
1010         Reviewed by Youenn Fablet.
1011
1012         Whenever a service worker client registers itself, also pass its effective user agent.
1013         In the network process, for each origin, we store the latest client's user agent and
1014         use it when starting the service worker.
1015
1016         * dom/Document.cpp:
1017         (WebCore::Document::setServiceWorkerConnection):
1018         * loader/DocumentLoader.cpp:
1019         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
1020         * workers/service/SWClientConnection.h:
1021         * workers/service/server/SWServer.cpp:
1022         (WebCore::SWServer::serviceWorkerClientUserAgent const):
1023         (WebCore::SWServer::installContextData):
1024         (WebCore::SWServer::runServiceWorker):
1025         (WebCore::SWServer::registerServiceWorkerClient):
1026         * workers/service/server/SWServer.h:
1027         * workers/service/server/SWServerToContextConnection.h:
1028         * workers/service/server/SWServerWorker.cpp:
1029         (WebCore::SWServerWorker::userAgent const):
1030         * workers/service/server/SWServerWorker.h:
1031
1032 2018-12-21  Youenn Fablet  <youenn@apple.com>
1033
1034         RTCRtpSender.setParameters() does set active parameter
1035         https://bugs.webkit.org/show_bug.cgi?id=192848
1036
1037         Reviewed by Eric Carlson.
1038
1039         Covered by updated test.
1040
1041         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1042         (WebCore::updateRTCRtpSendParameters):
1043         The routine was updating the local value, not the out parameter.
1044
1045 2018-12-21  Eric Carlson  <eric.carlson@apple.com>
1046
1047         'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged
1048         https://bugs.webkit.org/show_bug.cgi?id=187896
1049         <rdar://problem/42681445>
1050
1051         Reviewed by Jer Noble.
1052
1053         No new tests, tested manually.
1054
1055         * platform/mediastream/mac/AVVideoCaptureSource.h:
1056         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1057         (WebCore::AVVideoCaptureSource::deviceDisconnected):
1058         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
1059         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
1060         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
1061         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
1062         (WebCore::deviceHasInputStreams):
1063         (WebCore::isValidCaptureDevice):
1064         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
1065         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
1066         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted.
1067         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
1068         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1069         (WebCore::CoreAudioSharedUnit::setCaptureDevice):
1070         (WebCore::CoreAudioSharedUnit::devicesChanged):
1071         (WebCore::CoreAudioSharedUnit::startProducingData):
1072         (WebCore::CoreAudioSharedUnit::startInternal):
1073         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
1074         (WebCore::CoreAudioSharedUnit::captureFailed):
1075         (WebCore::CoreAudioCaptureSourceFactory::devicesChanged):
1076         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
1077         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted.
1078         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1079
1080 2018-12-20  Ryosuke Niwa  <rniwa@webkit.org>
1081
1082         REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running
1083         TestWebKitAPI.QuickLook.LegacyQuickLookContent
1084         https://bugs.webkit.org/show_bug.cgi?id=192859
1085         <rdar://problem/46887237>
1086
1087         Reviewed by Antti Koivisto.
1088
1089         After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread
1090         is inside a delegate callback even when there is a ScriptDisallowedScope defined.
1091
1092         Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed()
1093         by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion.
1094
1095         Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent
1096
1097         * dom/ContainerNodeAlgorithms.cpp:
1098         (WebCore::notifyChildNodeInserted):
1099         (WebCore::notifyChildNodeRemoved):
1100         * dom/Document.cpp:
1101         (WebCore::Document::nodeChildrenWillBeRemoved):
1102         (WebCore::Document::nodeWillBeRemoved):
1103         * dom/ScriptDisallowedScope.h:
1104         (WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope):
1105         * html/HTMLFormElement.cpp:
1106         (WebCore:: const):
1107
1108 2018-12-21  Joseph Pecoraro  <pecoraro@apple.com>
1109
1110         Update status of some WebCore features in features.json
1111         https://bugs.webkit.org/show_bug.cgi?id=192998
1112
1113         Reviewed by Tim Horton.
1114
1115         * features.json:
1116         - Variation Fonts: Supported
1117         - Conic Gradients: Supported in Preview
1118         - Web Share: Supported in Preview
1119         - <datalist>: Supported in Preview
1120         - Intersection Observers: Supported in Preview
1121
1122 2018-12-21  Zalan Bujtas  <zalan@apple.com>
1123
1124         [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
1125         https://bugs.webkit.org/show_bug.cgi?id=192357
1126         <rdar://problem/42852260>
1127
1128         Reviewed by Simon Fraser.
1129
1130         Do not try to paint the file picker when painting is disabled.
1131
1132         * rendering/RenderFileUploadControl.cpp:
1133         (WebCore::RenderFileUploadControl::paintObject):
1134
1135 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
1136
1137         [WebAuthN] userPresence should always be true
1138         https://bugs.webkit.org/show_bug.cgi?id=192835
1139         <rdar://problem/46538788>
1140
1141         Reviewed by Brent Fulgham.
1142
1143         In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification.
1144         This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123.
1145         After discussing with other members of the working group, we decided to make userPresence always default to true.
1146
1147         Covered by exisiting tests.
1148
1149         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
1150         (fido::encodeGetAssertionRequestAsCBOR):
1151
1152 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
1153
1154         [WebAuthN] Import an APDU coder from Chromium
1155         https://bugs.webkit.org/show_bug.cgi?id=192949
1156         <rdar://problem/46879933>
1157
1158         Reviewed by Brent Fulgham.
1159
1160         This patch imports an APDU coder from Chromium. Here is the documentation:
1161         https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
1162         APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
1163
1164         Here is a list of files that are imported from Chromium:
1165         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
1166         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1167         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1168         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1169         https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1170
1171         Covered by API tests.
1172
1173         * Modules/webauthn/apdu/ApduCommand.cpp: Added.
1174         (apdu::ApduCommand::createFromMessage):
1175         (apdu::ApduCommand::ApduCommand):
1176         (apdu::ApduCommand::getEncodedCommand const):
1177         * Modules/webauthn/apdu/ApduCommand.h: Added.
1178         * Modules/webauthn/apdu/ApduResponse.cpp: Added.
1179         (apdu::ApduResponse::createFromMessage):
1180         (apdu::ApduResponse::ApduResponse):
1181         (apdu::ApduResponse::getEncodedResponse const):
1182         * Modules/webauthn/apdu/ApduResponse.h: Added.
1183         * Sources.txt:
1184         * WebCore.xcodeproj/project.pbxproj:
1185
1186 2018-12-21  Jer Noble  <jer.noble@apple.com>
1187
1188         Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC
1189         https://bugs.webkit.org/show_bug.cgi?id=192985
1190         <rdar://problem/46750743>
1191
1192         Reviewed by Eric Carlson.
1193
1194         Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr.
1195
1196         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
1197         (WebCore::WebKitMediaKeys::setMediaElement):
1198         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
1199         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1200         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1201         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1202         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1203         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
1204
1205 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
1206
1207         CSS variables don't work for colors in "border" property
1208         https://bugs.webkit.org/show_bug.cgi?id=192922
1209
1210         Reviewed by Simon Fraser.
1211
1212         ParseColorFunction no longer consumes anything if the color was not valid.
1213
1214         Test: css-custom-properties-api/border-variable-parsing.html
1215
1216         * css/parser/CSSPropertyParserHelpers.cpp:
1217         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
1218
1219 2018-12-21  Justin Fan  <justin_fan@apple.com>
1220
1221         [WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging
1222         https://bugs.webkit.org/show_bug.cgi?id=192990
1223
1224         Reviewed by Myles C. Maxfield.
1225
1226         Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation.
1227         Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions.
1228
1229         No new tests; no change in behavior.
1230
1231         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
1232         (WebCore::WebGPUBindGroupLayout::create):
1233         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
1234         * Modules/webgpu/WebGPUBindGroupLayout.h:
1235         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
1236         * Modules/webgpu/WebGPUDevice.cpp:
1237         (WebCore::WebGPUDevice::createBindGroupLayout const):
1238         * platform/graphics/gpu/GPUBindGroupLayout.h:
1239         * platform/graphics/gpu/GPUDevice.cpp:
1240         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr. 
1241         (WebCore::GPUDevice::createBindGroupLayout const): Deleted.
1242         * platform/graphics/gpu/GPUDevice.h:
1243         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1244         (WebCore::appendArgumentToArray):
1245         (WebCore::newEncoder):
1246         (WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr.
1247         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
1248         (WebCore::appendArgumentToArrayInMap): Deleted.
1249         (WebCore::GPUBindGroupLayout::create): Deleted.
1250
1251         Deleted unneeded GPUBindGroupLayout.cpp:
1252         * Sources.txt:
1253         * WebCore.xcodeproj/project.pbxproj:
1254         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed.
1255
1256 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
1257
1258         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
1259         https://bugs.webkit.org/show_bug.cgi?id=190466
1260
1261         Reviewed by Youenn Fablet.
1262
1263         Added persistency to the DeviceIdHashSaltStorage.
1264
1265         * platform/glib/FileSystemGlib.cpp:
1266         (WebCore::FileSystem::getFileSize): Implemented this function to
1267         allow sharing code with the statistics storage class.
1268         * platform/glib/KeyedDecoderGlib.cpp:
1269         (WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a
1270         condition to control situations where the key is empty, it can
1271         happen if the user modifies the file in the disk.
1272         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include
1273         to make work compilation with debug, unified builds.
1274
1275 2018-12-21  Zalan Bujtas  <zalan@apple.com>
1276
1277         Synchronous media query evaluation could destroy current Frame/FrameView.
1278         https://bugs.webkit.org/show_bug.cgi?id=192781
1279         <rdar://problem/34416793>
1280
1281         Reviewed by Chris Dumez.
1282
1283         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
1284
1285         Test: printing/print-with-media-query-destory.html
1286
1287         * loader/DocumentLoader.cpp:
1288         (WebCore::DocumentLoader::finishedLoading):
1289         * page/Frame.cpp:
1290         (WebCore::Frame::setPrinting):
1291         * page/FrameView.cpp:
1292         (WebCore::FrameView::forceLayoutForPagination):
1293         * page/PrintContext.cpp:
1294         (WebCore::PrintContext::PrintContext):
1295         (WebCore::PrintContext::computePageRects):
1296         (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
1297         (WebCore::PrintContext::begin):
1298         (WebCore::PrintContext::computeAutomaticScaleFactor):
1299         (WebCore::PrintContext::spoolPage):
1300         (WebCore::PrintContext::spoolRect):
1301         (WebCore::PrintContext::end):
1302         * page/PrintContext.h:
1303         (WebCore::PrintContext::frame const): Deleted.
1304
1305 2018-12-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1306
1307         Setting the file wrapper and content type of an attachment to a PDF should update its image
1308         https://bugs.webkit.org/show_bug.cgi?id=192984
1309         <rdar://problem/46798028>
1310
1311         Reviewed by Tim Horton.
1312
1313         Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment.
1314         Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment.
1315
1316         * html/HTMLAttachmentElement.cpp:
1317         (WebCore::mimeTypeIsSuitableForInlineImageAttachment):
1318         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
1319
1320 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
1321
1322         Repeated background images with zero size should display the background color
1323         https://bugs.webkit.org/show_bug.cgi?id=192962
1324
1325         Reviewed by Antti Koivisto.
1326
1327         Test: fast/backgrounds/background-repeat-with-zero-size.html
1328
1329         * platform/LengthSize.h:
1330         (WebCore::LengthSize::isEmpty const):
1331         * rendering/RenderBoxModelObject.cpp:
1332         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1333         * rendering/style/FillLayer.h:
1334         (WebCore::FillLayer::isEmpty const):
1335
1336 2018-12-21  Manuel Rego Casasnovas  <rego@igalia.com>
1337
1338         [css-grid] Fix percentages in relative offsets for grid items
1339         https://bugs.webkit.org/show_bug.cgi?id=190492
1340
1341         Reviewed by Sergio Villar Senin.
1342
1343         The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items,
1344         where the containing block is the grid area.
1345         The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required.
1346
1347         Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
1348
1349         * rendering/RenderBox.cpp: Implement the physical versions of the already existent methods.
1350         (WebCore::RenderBox::overrideContainingBlockContentWidth const):
1351         (WebCore::RenderBox::overrideContainingBlockContentHeight const):
1352         (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
1353         (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
1354         * rendering/RenderBox.h:
1355         * rendering/RenderBoxModelObject.cpp:
1356         (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
1357         to take into account overrideContainingBlockContentWidth|Height for grid items.
1358         * rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
1359         that will be overridden in RenderBox.
1360         (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
1361         (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
1362         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
1363         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):
1364
1365 2018-12-20  Justin Fan  <justin_fan@apple.com>
1366
1367         [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders
1368         https://bugs.webkit.org/show_bug.cgi?id=192956
1369
1370         Reviewed by Myles Maxfield.
1371
1372         No testable behavior change. Existing tests cover possible crashing.
1373
1374         Add GPUBindGroupLayoutMetal.mm:
1375         * SourcesCocoa.txt:
1376         * WebCore.xcodeproj/project.pbxproj:
1377
1378         Flesh out GPUBindGroupLayout::create:
1379         * platform/graphics/gpu/GPUBindGroupLayout.cpp:
1380         * platform/graphics/gpu/GPUBindGroupLayout.h:
1381         * platform/graphics/gpu/GPUDevice.cpp:
1382         (WebCore::GPUDevice::createBindGroupLayout const):
1383         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added.
1384         (WebCore::appendArgumentToArrayInMap): Added.
1385         (WebCore::GPUBindGroupLayout::create):
1386         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
1387         (WebCore::MTLDataTypeForBindingType): Added.
1388
1389 2018-12-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1390
1391         Unreviewed, remove stray #pragma once added to .cpp file
1392
1393         * svg/properties/SVGAttributeOwnerProxy.cpp:
1394
1395 2018-12-20  Justin Michaud  <justin_michaud@apple.com>
1396
1397         Adding runtime-enabled attribute to Element prevents inlining property access
1398         https://bugs.webkit.org/show_bug.cgi?id=192901
1399
1400         Add a call to flattenDictionaryObject after disabling runtime-enabled attributes.
1401
1402         Reviewed by Ryosuke Niwa.
1403
1404         * bindings/scripts/CodeGeneratorJS.pm:
1405         (GenerateImplementation):
1406         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1407         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
1408         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1409         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
1410         * bindings/scripts/test/JS/JSTestNode.cpp:
1411         (WebCore::JSTestNodePrototype::finishCreation):
1412         * bindings/scripts/test/JS/JSTestObj.cpp:
1413         (WebCore::JSTestObjPrototype::finishCreation):
1414
1415 2018-12-20  Chris Dumez  <cdumez@apple.com>
1416
1417         Use Optional::hasValue() instead of Optional::has_value()
1418         https://bugs.webkit.org/show_bug.cgi?id=192948
1419
1420         Reviewed by Tim Horton.
1421
1422         * bindings/js/DOMPromiseProxy.h:
1423         (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
1424         (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
1425         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
1426         * dom/DataTransferItemList.h:
1427         (WebCore::DataTransferItemList::hasItems const):
1428         * dom/EventTarget.cpp:
1429         (WebCore::EventTarget::addEventListener):
1430         * html/HTMLMediaElement.cpp:
1431         (WebCore::HTMLMediaElement::captionDisplayMode):
1432         * platform/graphics/MediaPlayer.cpp:
1433         (WebCore::MediaPlayer::wouldTaintOrigin const):
1434         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1435         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1436         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1437         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
1438         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1439         (webKitMediaSrcUpdatePresentationSize):
1440         * platform/mac/NSScrollerImpDetails.mm:
1441         (WebCore::ScrollerStyle::recommendedScrollerStyle):
1442         * rendering/RenderListItem.cpp:
1443         (WebCore::RenderListItem::setExplicitValue):
1444
1445 2018-12-20  Chris Dumez  <cdumez@apple.com>
1446
1447         Move HTTPS_UPGRADE code behind a runtime flag, off by default
1448         https://bugs.webkit.org/show_bug.cgi?id=192937
1449
1450         Reviewed by Youenn Fablet.
1451
1452         Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
1453
1454         * page/Settings.yaml:
1455
1456 2018-12-20  Youenn Fablet  <youenn@apple.com>
1457
1458         Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
1459         https://bugs.webkit.org/show_bug.cgi?id=192838
1460
1461         Reviewed by Chris Dumez.
1462
1463         Generate constructor code in case of a Private but not Public constructor.
1464         Make sure this is correctly exposed in global objects.
1465         Add JS built-in constructor implementations for those two objects.
1466
1467         Also add JS built-in constructors for controller and byob request.
1468         To keep existing behavior, JS built-ins calling these constructors need to pass
1469         an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
1470         In the latter case, the constructor will throw.
1471
1472         Covered by existing tests, no observable change of behavior.
1473
1474         * Modules/streams/ReadableByteStreamController.idl:
1475         * Modules/streams/ReadableByteStreamController.js:
1476         (initializeReadableByteStreamController):
1477         (getter.byobRequest):
1478         * Modules/streams/ReadableByteStreamInternals.js:
1479         (privateInitializeReadableByteStreamController): Deleted.
1480         (privateInitializeReadableStreamBYOBRequest): Deleted.
1481         * Modules/streams/ReadableStream.js:
1482         (initializeReadableStream):
1483         * Modules/streams/ReadableStreamBYOBReader.js:
1484         (initializeReadableStreamBYOBReader):
1485         * Modules/streams/ReadableStreamBYOBRequest.idl:
1486         * Modules/streams/ReadableStreamBYOBRequest.js:
1487         (initializeReadableStreamBYOBRequest):
1488         * Modules/streams/ReadableStreamDefaultController.idl:
1489         * Modules/streams/ReadableStreamDefaultController.js:
1490         (initializeReadableStreamDefaultController):
1491         (enqueue):
1492         * Modules/streams/ReadableStreamDefaultReader.js:
1493         (initializeReadableStreamDefaultReader):
1494         * Modules/streams/ReadableStreamInternals.js:
1495         (readableStreamDefaultControllerError): Deleted.
1496         * Sources.txt:
1497         * UnifiedSources-input.xcfilelist:
1498         * WebCore.xcodeproj/project.pbxproj:
1499         * bindings/js/JSDOMBuiltinConstructor.h:
1500         * bindings/js/JSDOMGlobalObject.cpp:
1501         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1502         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
1503         * bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
1504         * bindings/scripts/CodeGeneratorJS.pm:
1505         (GeneratePropertiesHashTable):
1506         * bindings/scripts/preprocess-idls.pl:
1507         (shouldExposeInterface):
1508
1509 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
1510
1511         [WebAuthN] Remove hash from Client Data
1512         https://bugs.webkit.org/show_bug.cgi?id=192727
1513         <rdar://problem/46746673>
1514
1515         Reviewed by Brent Fulgham.
1516
1517         The hash algorithm for hashing the client data is enforced to SHA_256 in the latest spec:
1518         https://www.w3.org/TR/webauthn/#sec-client-data. Therefore, we should remove it.
1519
1520         Covered by existing tests.
1521
1522         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1523         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson):
1524
1525 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
1526
1527         [WebAuthN] Add a runtime flag for local authenticator
1528         https://bugs.webkit.org/show_bug.cgi?id=192792
1529         <rdar://problem/46798738>
1530
1531         Reviewed by Brent Fulgham.
1532
1533         No tests.
1534
1535         This patch adds a runtime flag for local authenticator and removes ways to
1536         set the runtime flag for web authentication in LegacyWebKit.
1537
1538         * page/RuntimeEnabledFeatures.h:
1539         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled):
1540         (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const):
1541
1542 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
1543
1544         Pointer lock causes abandoned documents
1545         https://bugs.webkit.org/show_bug.cgi?id=188727
1546         rdar://problem/44248197
1547         
1548         Reviewed by Simon Fraser.
1549
1550         Fixes --world-leaks in these tests:
1551
1552         pointer-lock/locked-element-removed-from-dom.html
1553         pointer-lock/mouse-event-delivery.html
1554         fast/shadow-dom/pointerlockelement-in-slot.html
1555
1556         PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document.
1557
1558         * page/PointerLockController.cpp:
1559         (WebCore::PointerLockController::elementRemoved):
1560         (WebCore::PointerLockController::documentDetached):
1561         (WebCore::PointerLockController::didAcquirePointerLock):
1562         * page/PointerLockController.h:
1563
1564 2018-12-20  Chris Dumez  <cdumez@apple.com>
1565
1566         Use Optional::valueOr() instead of Optional::value_or()
1567         https://bugs.webkit.org/show_bug.cgi?id=192933
1568
1569         Reviewed by Geoffrey Garen.
1570
1571         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1572         (WebCore::convert):
1573         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
1574         * Modules/encryptedmedia/MediaKeySession.cpp:
1575         (WebCore::MediaKeySession::load):
1576         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1577         (WebCore::IDBDatabaseIdentifier::hash const):
1578         * Modules/indexeddb/IDBFactory.cpp:
1579         (WebCore::IDBFactory::open):
1580         * Modules/mediastream/MediaStreamTrack.cpp:
1581         (WebCore::MediaStreamTrack::applyConstraints):
1582         * Modules/mediastream/RTCDTMFSender.cpp:
1583         (WebCore::RTCDTMFSender::insertDTMF):
1584         * Modules/webdatabase/SQLTransaction.cpp:
1585         (WebCore::SQLTransaction::executeSql):
1586         * Modules/webvr/VRFrameData.cpp:
1587         (WebCore::VRFrameData::update):
1588         * animation/AnimationTimeline.cpp:
1589         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
1590         * animation/DeclarativeAnimation.cpp:
1591         (WebCore::DeclarativeAnimation::cancel):
1592         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1593         * animation/KeyframeEffect.cpp:
1594         (WebCore::computeMissingKeyframeOffsets):
1595         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1596         * animation/WebAnimation.cpp:
1597         (WebCore::WebAnimation::runPendingPlayTask):
1598         (WebCore::WebAnimation::runPendingPauseTask):
1599         * bindings/js/SerializedScriptValue.cpp:
1600         (WebCore::CloneSerializer::write):
1601         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1602         (WebCore::CryptoAlgorithmHMAC::generateKey):
1603         (WebCore::CryptoAlgorithmHMAC::importKey):
1604         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
1605         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1606         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1607         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1608         (WebCore::CryptoKeyRSA::importSpki):
1609         (WebCore::CryptoKeyRSA::importPkcs8):
1610         * crypto/keys/CryptoKeyRSA.cpp:
1611         (WebCore::CryptoKeyRSA::importJwk):
1612         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
1613         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1614         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1615         * crypto/mac/CryptoKeyRSAMac.cpp:
1616         (WebCore::CryptoKeyRSA::importSpki):
1617         (WebCore::CryptoKeyRSA::importPkcs8):
1618         * css/CSSComputedStyleDeclaration.cpp:
1619         (WebCore::counterToCSSValue):
1620         * css/CSSFontFace.cpp:
1621         (WebCore::calculateItalicRange):
1622         * css/CSSPrimitiveValue.cpp:
1623         (WebCore::CSSPrimitiveValue::doubleValue const):
1624         * css/CSSStyleSheet.cpp:
1625         (WebCore::CSSStyleSheet::addRule):
1626         * css/DOMMatrix.cpp:
1627         (WebCore::DOMMatrix::rotateSelf):
1628         * css/DOMMatrixReadOnly.cpp:
1629         (WebCore::DOMMatrixReadOnly::validateAndFixup):
1630         * css/StyleBuilderCustom.h:
1631         (WebCore::StyleBuilderCustom::applyValueCounter):
1632         * css/parser/MediaQueryParser.cpp:
1633         (WebCore::MediaQueryParser::commitMediaQuery):
1634         * dom/Document.h:
1635         (WebCore::Document::referrerPolicy const):
1636         * dom/Element.cpp:
1637         (WebCore::toScrollAlignment):
1638         * dom/EventTarget.cpp:
1639         (WebCore::EventTarget::addEventListener):
1640         * dom/MutationObserver.cpp:
1641         (WebCore::MutationObserver::observe):
1642         * editing/cocoa/FontAttributeChangesCocoa.mm:
1643         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
1644         * fileapi/File.cpp:
1645         (WebCore::File::File):
1646         * html/DOMTokenList.cpp:
1647         (WebCore::DOMTokenList::toggle):
1648         * html/HTMLOListElement.h:
1649         * html/ImageBitmap.cpp:
1650         (WebCore::croppedSourceRectangleWithFormatting):
1651         * html/canvas/CanvasPattern.cpp:
1652         (WebCore::CanvasPattern::setTransform):
1653         * html/canvas/CanvasRenderingContext2DBase.cpp:
1654         (WebCore::CanvasRenderingContext2DBase::setTransform):
1655         (WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
1656         (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
1657         * html/canvas/Path2D.cpp:
1658         (WebCore::Path2D::addPath):
1659         * inspector/InspectorCanvas.cpp:
1660         (WebCore::InspectorCanvas::buildAction):
1661         * inspector/InspectorFrontendHost.cpp:
1662         (WebCore::populateContextMenu):
1663         * layout/FormattingContext.cpp:
1664         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1665         * layout/FormattingContextGeometry.cpp:
1666         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1667         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1668         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1669         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1670         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1671         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1672         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
1673         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
1674         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
1675         * layout/FormattingContextQuirks.cpp:
1676         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1677         * layout/MarginTypes.h:
1678         (WebCore::Layout::VerticalMargin::usedValues const):
1679         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1680         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1681         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1682         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
1683         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1684         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1685         * layout/displaytree/DisplayBox.h:
1686         (WebCore::Display::Box::width const):
1687         (WebCore::Display::Box::height const):
1688         (WebCore::Display::Box::contentBoxTop const):
1689         (WebCore::Display::Box::contentBoxLeft const):
1690         * layout/floats/FloatingContext.cpp:
1691         (WebCore::Layout::Iterator::set):
1692         * layout/inlineformatting/InlineFormattingContext.cpp:
1693         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
1694         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
1695         * loader/FrameLoader.cpp:
1696         (WebCore::FrameLoader::urlSelected):
1697         * loader/NavigationAction.cpp:
1698         * page/FrameView.cpp:
1699         (WebCore::FrameView::setLayoutViewportOverrideRect):
1700         (WebCore::FrameView::documentToAbsoluteScaleFactor const):
1701         (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
1702         * page/Page.cpp:
1703         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
1704         * page/SecurityOriginData.cpp:
1705         (WebCore::SecurityOriginData::databaseIdentifier const):
1706         * page/SecurityOriginData.h:
1707         (WebCore::SecurityOriginDataHash::hash):
1708         * page/SecurityOriginHash.h:
1709         (WebCore::SecurityOriginHash::hash):
1710         * page/ViewportConfiguration.cpp:
1711         (WebCore::ViewportConfiguration::setViewLayoutSize):
1712         * page/WindowFeatures.cpp:
1713         (WebCore::parseDialogFeatures):
1714         * page/animation/AnimationBase.cpp:
1715         (WebCore::AnimationBase::updateStateMachine):
1716         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
1717         (WebCore::AnimationBase::getTimeToNextEvent const):
1718         (WebCore::AnimationBase::freezeAtTime):
1719         (WebCore::AnimationBase::getElapsedTime const):
1720         * page/animation/CSSAnimationController.cpp:
1721         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
1722         * page/cocoa/ResourceUsageThreadCocoa.mm:
1723         (WebCore::ResourceUsageThread::platformThreadBody):
1724         * page/linux/ResourceUsageThreadLinux.cpp:
1725         (WebCore::ResourceUsageThread::platformThreadBody):
1726         * platform/graphics/ComplexTextController.cpp:
1727         (WebCore::ComplexTextController::offsetForPosition):
1728         * platform/graphics/FontCache.h:
1729         (WebCore::FontDescriptionKey::computeHash const):
1730         * platform/graphics/FontCascade.cpp:
1731         (WebCore::FontCascade::drawText const):
1732         (WebCore::FontCascade::drawEmphasisMarks const):
1733         (WebCore::FontCascade::displayListForTextRun const):
1734         (WebCore::FontCascade::adjustSelectionRectForText const):
1735         (WebCore::FontCascade::codePath const):
1736         * platform/graphics/FontSelectionAlgorithm.cpp:
1737         (WebCore::FontSelectionAlgorithm::styleDistance const):
1738         * platform/graphics/FontSelectionAlgorithm.h:
1739         (WebCore::operator<<):
1740         (WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
1741         (WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
1742         (WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
1743         * platform/graphics/ShadowBlur.cpp:
1744         (WebCore::ShadowBlur::calculateLayerBoundingRect):
1745         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1746         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1747         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1748         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1749         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1750         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
1751         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1752         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
1753         * platform/graphics/ca/GraphicsLayerCA.cpp:
1754         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1755         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1756         (WebCore::preparePlatformFont):
1757         * platform/graphics/filters/FETurbulence.cpp:
1758         (WebCore::FETurbulence::fillRegion const):
1759         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1760         (WebCore::initializeGStreamer):
1761         * platform/graphics/texmap/TextureMapperLayer.cpp:
1762         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
1763         (WebCore::TextureMapperLayer::replicaTransform):
1764         (WebCore::TextureMapperLayer::syncAnimations):
1765         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1766         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
1767         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
1768         * platform/graphics/transforms/TransformState.cpp:
1769         (WebCore::TransformState::mappedPoint const):
1770         (WebCore::TransformState::mapQuad const):
1771         (WebCore::TransformState::flattenWithTransform):
1772         * platform/network/CacheValidation.cpp:
1773         (WebCore::computeCurrentAge):
1774         (WebCore::computeFreshnessLifetimeForHTTPFamily):
1775         * platform/network/NetworkStateNotifier.cpp:
1776         (WebCore::NetworkStateNotifier::onLine):
1777         * rendering/FloatingObjects.cpp:
1778         (WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const):
1779         (WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const):
1780         * rendering/GridBaselineAlignment.cpp:
1781         (WebCore::GridBaselineAlignment::ascentForChild const):
1782         * rendering/GridTrackSizingAlgorithm.cpp:
1783         (WebCore::GridTrack::setGrowthLimit):
1784         (WebCore::GridTrackSizingAlgorithm::initialBaseSize const):
1785         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const):
1786         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
1787         (WebCore::sortByGridTrackGrowthPotential):
1788         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
1789         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1790         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
1791         * rendering/PaintInfo.h:
1792         (WebCore::PaintInfo::applyTransform):
1793         * rendering/RenderBox.cpp:
1794         (WebCore::RenderBox::computeLogicalHeight const):
1795         * rendering/RenderCounter.cpp:
1796         (WebCore::planCounter):
1797         * rendering/RenderDeprecatedFlexibleBox.cpp:
1798         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1799         * rendering/RenderFlexibleBox.cpp:
1800         (WebCore::RenderFlexibleBox::baselinePosition const):
1801         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
1802         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
1803         * rendering/RenderGrid.cpp:
1804         (WebCore::RenderGrid::gridGap const):
1805         (WebCore::RenderGrid::baselinePosition const):
1806         * rendering/RenderLayer.cpp:
1807         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1808         * rendering/RenderListBox.cpp:
1809         (WebCore::RenderListBox::paintItem):
1810         (WebCore::RenderListBox::listIndexIsVisible):
1811         * rendering/RenderMultiColumnSet.cpp:
1812         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
1813         * rendering/RenderTable.cpp:
1814         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
1815         * rendering/RenderTableCell.cpp:
1816         (WebCore::RenderTableCell::cellBaselinePosition const):
1817         * rendering/RenderTableSection.cpp:
1818         (WebCore::RenderTableSection::firstLineBaseline const):
1819         * rendering/RenderText.cpp:
1820         (WebCore::RenderText::computePreferredLogicalWidths):
1821         (WebCore::RenderText::previousOffset const):
1822         (WebCore::RenderText::previousOffsetForBackwardDeletion const):
1823         (WebCore::RenderText::nextOffset const):
1824         (WebCore::RenderText::stringView const):
1825         * rendering/RenderView.cpp:
1826         (WebCore::RenderView::layout):
1827         * rendering/mathml/RenderMathMLBlock.cpp:
1828         (WebCore::RenderMathMLBlock::baselinePosition const):
1829         * rendering/mathml/RenderMathMLBlock.h:
1830         (WebCore::RenderMathMLBlock::ascentForChild):
1831         * rendering/style/GridPosition.cpp:
1832         (WebCore::GridPosition::max):
1833         * rendering/style/TextUnderlineOffset.h:
1834         (WebCore::TextUnderlineOffset::lengthOr const):
1835         * rendering/svg/RenderSVGContainer.cpp:
1836         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
1837         * rendering/svg/RenderSVGForeignObject.cpp:
1838         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
1839         * rendering/svg/RenderSVGImage.cpp:
1840         (WebCore::RenderSVGImage::nodeAtFloatPoint):
1841         * rendering/svg/RenderSVGResourceClipper.cpp:
1842         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
1843         * rendering/svg/RenderSVGResourceFilter.cpp:
1844         (WebCore::RenderSVGResourceFilter::postApplyResource):
1845         * rendering/svg/RenderSVGRoot.cpp:
1846         (WebCore::RenderSVGRoot::nodeAtPoint):
1847         * rendering/svg/RenderSVGShape.cpp:
1848         (WebCore::RenderSVGShape::nodeAtFloatPoint):
1849         * rendering/svg/RenderSVGText.cpp:
1850         (WebCore::RenderSVGText::nodeAtFloatPoint):
1851         * rendering/svg/SVGRenderingContext.cpp:
1852         (WebCore::SVGRenderingContext::clipToImageBuffer):
1853         * svg/SVGToOTFFontConversion.cpp:
1854         (WebCore::SVGToOTFFontConverter::processGlyphElement):
1855         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1856
1857 2018-12-20  Jer Noble  <jer.noble@apple.com>
1858
1859         REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback()
1860         https://bugs.webkit.org/show_bug.cgi?id=192941
1861         <rdar://problem/46874096>
1862
1863         Reviewed by Brent Fulgham.
1864
1865         Don't delete the locked lock before unlocking the lock. 
1866
1867         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1868         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
1869
1870 2018-12-20  Keith Rollin  <krollin@apple.com>
1871
1872         Improve release-level page-load logging
1873         https://bugs.webkit.org/show_bug.cgi?id=192872
1874         <rdar://problem/46850309>
1875
1876         Reviewed by Chris Dumez.
1877
1878         There are a number of reported bugs that are difficult or impossible
1879         to track down with our current level of logging. Additionally, some
1880         software groups lower in the page-loading stack have requested logging
1881         sufficient for tracking a user-visible error message down to the
1882         requested resource that caused the message. Add more-comprehensive
1883         logging to address these issues/requests.
1884
1885         No new tests -- no changed functionality.
1886
1887         * loader/DocumentLoader.cpp:
1888         (WebCore::DocumentLoader::setMainDocumentError):
1889         (WebCore::DocumentLoader::mainReceivedError):
1890         (WebCore::DocumentLoader::stopLoading):
1891         (WebCore::DocumentLoader::notifyFinished):
1892         (WebCore::DocumentLoader::willSendRequest):
1893         (WebCore::DocumentLoader::continueAfterContentPolicy):
1894         (WebCore::DocumentLoader::startLoadingMainResource):
1895         (WebCore::DocumentLoader::loadMainResource):
1896         (WebCore::DocumentLoader::cancelMainResourceLoad):
1897         * loader/FrameLoader.cpp:
1898         (WebCore::FrameLoader::urlSelected):
1899         (WebCore::FrameLoader::loadURLIntoChildFrame):
1900         (WebCore::FrameLoader::loadArchive):
1901         (WebCore::FrameLoader::loadInSameDocument):
1902         (WebCore::FrameLoader::loadFrameRequest):
1903         (WebCore::FrameLoader::loadURL):
1904         (WebCore::FrameLoader::load):
1905         (WebCore::FrameLoader::loadWithNavigationAction):
1906         (WebCore::FrameLoader::loadWithDocumentLoader):
1907         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1908         (WebCore::FrameLoader::reload):
1909         (WebCore::FrameLoader::setState):
1910         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1911         (WebCore::FrameLoader::loadPostRequest):
1912         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1913         (WebCore::FrameLoader::loadDifferentDocumentItem):
1914         * loader/ProgressTracker.cpp:
1915         (WebCore::ProgressItem::ProgressItem):
1916         (WebCore::ProgressTracker::reset):
1917         (WebCore::ProgressTracker::progressStarted):
1918         (WebCore::ProgressTracker::progressCompleted):
1919         (WebCore::ProgressTracker::finalProgressComplete):
1920         (WebCore::ProgressTracker::incrementProgress):
1921         (WebCore::ProgressTracker::completeProgress):
1922         (WebCore::ProgressTracker::isAlwaysOnLoggingAllowed const):
1923         * loader/ProgressTracker.h:
1924         * loader/ResourceLoader.cpp:
1925         (WebCore::ResourceLoader::loadDataURL):
1926         (WebCore::ResourceLoader::willSendRequestInternal):
1927         (WebCore::ResourceLoader::didFinishLoading):
1928         (WebCore::ResourceLoader::didFail):
1929         (WebCore::ResourceLoader::willSendRequestAsync):
1930         (WebCore::ResourceLoader::wasBlocked):
1931         (WebCore::ResourceLoader::cannotShowURL):
1932         * loader/SubresourceLoader.cpp:
1933         (WebCore::SubresourceLoader::willSendRequestInternal):
1934         (WebCore::=):
1935         (WebCore::SubresourceLoader::didReceiveResponse):
1936         (WebCore::SubresourceLoader::didFinishLoading):
1937         (WebCore::SubresourceLoader::didFail):
1938         (WebCore::SubresourceLoader::willCancel):
1939         * loader/cache/CachedResource.cpp:
1940         (WebCore::CachedResource::load):
1941
1942 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
1943
1944         Switch tabs before retuning PiP video to inline.
1945         https://bugs.webkit.org/show_bug.cgi?id=192767
1946         rdar://problem/46006046
1947
1948         Reviewed by Jer Noble.
1949
1950         No new tests because this code path only happens with a user action on system UI.
1951
1952         When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.
1953
1954         * platform/mac/VideoFullscreenInterfaceMac.mm:
1955         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
1956
1957 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1958
1959         Unreviewed, fix GTK build after r239410
1960
1961         It added a new file to the build, breaking the unified sources magic that obscured a bug in
1962         URLSoup.h. It forward-declares URL, but this never worked unless the URL.h header was
1963         included via another source file in the unified source bundle.
1964
1965         * platform/network/soup/URLSoup.h:
1966
1967 2018-12-19  Chris Dumez  <cdumez@apple.com>
1968
1969         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
1970         https://bugs.webkit.org/show_bug.cgi?id=192728
1971         <rdar://problem/46746779>
1972
1973         Reviewed by Geoff Garen.
1974
1975         * Modules/*:
1976         * animation/*:
1977         * bindings/*:
1978         * crypto/*:
1979         * css/*:
1980         * dom/*:
1981         * editing/*:
1982         * fileapi/*:
1983         * html/*:
1984         * inspector/*:
1985         * layout/*:
1986         * loader/*:
1987         * mathml/*:
1988         * page/*:
1989         * platform/*:
1990         * plugins/*:
1991         * rendering/*:
1992         * testing/*:
1993         * workers/*:
1994         * xml/*:
1995
1996 2018-12-19  Jer Noble  <jer.noble@apple.com>
1997
1998         Leak of MTAudioProcessingTap (304 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1999         https://bugs.webkit.org/show_bug.cgi?id=192896
2000         <rdar://46732186>
2001
2002         Reviewed by Eric Carlson.
2003
2004         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2005         (WebCore::AudioSourceProviderAVFObjC::initCallback):
2006
2007 2018-12-19  Timothy Hatcher  <timothy@apple.com>
2008
2009         REGRESSION (r232991): Switching to dark mode in Mail does not update the message view to be transparent
2010         https://bugs.webkit.org/show_bug.cgi?id=188891
2011         rdar://problem/42344352
2012
2013         Reviewed by Simon Fraser.
2014
2015         * rendering/RenderLayerCompositor.cpp:
2016         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
2017         Don't return early when m_layerForOverhangAreas is null to avoid skipping
2018         setRootLayerConfigurationNeedsUpdate() and scheduleCompositingLayerUpdate().
2019
2020 2018-12-19  Justin Fan  <justin_fan@apple.com>
2021
2022         [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
2023         https://bugs.webkit.org/show_bug.cgi?id=192843
2024         <rdar://problem/46820395>
2025
2026         Reviewed by Myles Maxfield.
2027
2028         Test: webgpu/pipeline-layouts.html
2029
2030         Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout:
2031         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
2032         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
2033         * Modules/webgpu/WebGPUBindGroupLayout.h:
2034         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter.
2035         * Modules/webgpu/WebGPUDevice.cpp:
2036         (WebCore::WebGPUDevice::createPipelineLayout const): Added.
2037         * Modules/webgpu/WebGPUDevice.h:
2038         * Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout.
2039         * Modules/webgpu/WebGPUPipelineLayout.cpp: Added.
2040         (WebCore::WebGPUPipelineLayout::create):
2041         (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
2042         * Modules/webgpu/WebGPUPipelineLayout.h: Added.
2043         * Modules/webgpu/WebGPUPipelineLayout.idl: Added.
2044         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added.
2045         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added.
2046         * platform/graphics/gpu/GPUDevice.cpp:
2047         (WebCore::GPUDevice::createPipelineLayout const): Added.
2048         * platform/graphics/gpu/GPUDevice.h:
2049         * platform/graphics/gpu/GPUPipelineLayout.cpp: Added.
2050         (WebCore::GPUPipelineLayout::create):
2051         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
2052         * platform/graphics/gpu/GPUPipelineLayout.h: Added.
2053         * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added.
2054
2055         Add files and symbols to project:
2056         * CMakeLists.txt:
2057         * DerivedSources.make:
2058         * Sources.txt:
2059         * WebCore.xcodeproj/project.pbxproj:
2060         * bindings/js/WebCoreBuiltinNames.h:
2061
2062         Add missing include:
2063         * Modules/webgpu/WebGPUQueue.h:
2064
2065 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
2066
2067         SVGUseElement::findTarget should return nullptr when there is a cycle
2068         https://bugs.webkit.org/show_bug.cgi?id=192840
2069
2070         Reviewed by Tim Horton.
2071
2072         r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target.
2073         Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when
2074         the SVG use element itself had a corresponding element.
2075
2076         No new tests since there should be no behavioral change.
2077
2078         * svg/SVGUseElement.cpp:
2079         (WebCore::SVGUseElement::updateShadowTree):
2080         (WebCore::SVGUseElement::findTarget const):
2081
2082 2018-12-19  Myles C. Maxfield  <mmaxfield@apple.com>
2083
2084         [WHLSL] Add a handwritten lexer
2085         https://bugs.webkit.org/show_bug.cgi?id=192294
2086
2087         Reviewed by Jon Lee.
2088
2089         This is infrastructure necessary for https://bugs.webkit.org/show_bug.cgi?id=192355. The
2090         implementation matches the lexing rules in the spec (specifically, the rules that start
2091         with an uppercase letter). The spec is at
2092         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4.
2093
2094         This patch also modifies the lexer according to https://github.com/gpuweb/WHLSL/pull/283.
2095
2096         No new tests because the lexer isn't hooked up yet; there are tests in the parser,
2097         once that gets committed.
2098
2099         * Modules/webgpu/WHLSL/WHLSLLexer.cpp: Added.
2100         (WebCore::WHLSL::Lexer::Token::typeName):
2101         (WebCore::WHLSL::Lexer::recognizeKeyword):
2102         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
2103         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
2104         (WebCore::WHLSL::isWhitespace):
2105         (WebCore::WHLSL::isNewline):
2106         (WebCore::WHLSL::Lexer::skipWhitespace):
2107         (WebCore::WHLSL::Lexer::skipLineComment):
2108         (WebCore::WHLSL::Lexer::skipLongComment):
2109         (WebCore::WHLSL::Lexer::coreDecimalIntLiteral const):
2110         (WebCore::WHLSL::Lexer::decimalIntLiteral const):
2111         (WebCore::WHLSL::Lexer::decimalUintLiteral const):
2112         (WebCore::WHLSL::isHexadecimalCharacter):
2113         (WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const):
2114         (WebCore::WHLSL::Lexer::hexadecimalIntLiteral const):
2115         (WebCore::WHLSL::Lexer::hexadecimalUintLiteral const):
2116         (WebCore::WHLSL::Lexer::intLiteral const):
2117         (WebCore::WHLSL::Lexer::uintLiteral const):
2118         (WebCore::WHLSL::Lexer::digit const):
2119         (WebCore::WHLSL::Lexer::digitStar const):
2120         (WebCore::WHLSL::Lexer::character const):
2121         (WebCore::WHLSL::Lexer::coreFloatLiteralType1 const):
2122         (WebCore::WHLSL::Lexer::coreFloatLiteral const):
2123         (WebCore::WHLSL::Lexer::floatLiteral const):
2124         (WebCore::WHLSL::Lexer::validIdentifier const):
2125         (WebCore::WHLSL::Lexer::identifier const):
2126         (WebCore::WHLSL::Lexer::operatorName const):
2127         * Modules/webgpu/WHLSL/WHLSLLexer.h: Added.
2128         (WebCore::WHLSL::Lexer::Lexer):
2129         (WebCore::WHLSL::Lexer::consumeToken):
2130         (WebCore::WHLSL::Lexer::unconsumeToken):
2131         (WebCore::WHLSL::Lexer::state const):
2132         (WebCore::WHLSL::Lexer::setState):
2133         (WebCore::WHLSL::Lexer::isFullyConsumed const):
2134         (WebCore::WHLSL::Lexer::errorString):
2135         (WebCore::WHLSL::Lexer::string const):
2136         (WebCore::WHLSL::Lexer::anyCharacter const):
2137         * Sources.txt:
2138         * WebCore.xcodeproj/project.pbxproj:
2139
2140 2018-12-18  Simon Fraser  <simon.fraser@apple.com>
2141
2142         Web Inspector: Timelines: correctly label Intersection Observer callbacks
2143         https://bugs.webkit.org/show_bug.cgi?id=192669
2144         <rdar://problem/46702490>
2145
2146         Reviewed by Joseph Pecoraro.
2147
2148         Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
2149         to Intersection Observer, Performance Observer and Mutation Observer callbacks so 
2150         that they get correctly labeled in the Inspector timeline.
2151
2152         * dom/MutationObserver.cpp:
2153         (WebCore::MutationObserver::deliver):
2154         * en.lproj/Localizable.strings:
2155         * inspector/InspectorInstrumentation.cpp:
2156         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
2157         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
2158         * inspector/InspectorInstrumentation.h:
2159         (WebCore::InspectorInstrumentation::willFireObserverCallback):
2160         (WebCore::InspectorInstrumentation::didFireObserverCallback):
2161         * inspector/TimelineRecordFactory.cpp:
2162         (WebCore::TimelineRecordFactory::createObserverCallbackData):
2163         * inspector/TimelineRecordFactory.h:
2164         * inspector/agents/InspectorTimelineAgent.cpp:
2165         (WebCore::InspectorTimelineAgent::willFireObserverCallback):
2166         (WebCore::InspectorTimelineAgent::didFireObserverCallback):
2167         (WebCore::toProtocol):
2168         * inspector/agents/InspectorTimelineAgent.h:
2169         * page/IntersectionObserver.cpp:
2170         (WebCore::IntersectionObserver::notify):
2171         * page/PerformanceObserver.cpp:
2172         (WebCore::PerformanceObserver::deliver):
2173
2174 2018-12-19  Claudio Saavedra  <csaavedra@igalia.com>
2175
2176         ContentExtensions: DFANode.cpp:66:44: error: narrowing conversion of '-1' from 'int' to 'char' inside { }
2177         https://bugs.webkit.org/show_bug.cgi?id=192854
2178
2179         Reviewed by Alex Christensen.
2180
2181         * contentextensions/DFANode.h: Define CharRange's chars as signed
2182
2183 2018-12-19  Youenn Fablet  <youenn@apple.com>
2184
2185         Remove RTCRtpTransceiver.setDirection
2186         https://bugs.webkit.org/show_bug.cgi?id=192869
2187
2188         Reviewed by Alex Christensen.
2189
2190         Covered by rebased test.
2191
2192         * Modules/mediastream/RTCRtpTransceiver.idl:
2193
2194 2018-12-19  Jer Noble  <jer.noble@apple.com>
2195
2196         Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
2197         https://bugs.webkit.org/show_bug.cgi?id=192856
2198         <rdar://problem/46843245>
2199
2200         Reviewed by Alex Christensen.
2201
2202         Some decoders exposed through VideoToolbox will decode asynchronously even when 
2203         kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.
2204
2205         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2206         (WebCore::WebCoreDecompressionSession::decodeSampleSync):
2207
2208 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
2209
2210         Allow clients to set the navigator platform
2211         https://bugs.webkit.org/show_bug.cgi?id=192735
2212
2213         Reviewed by Tim Horton.
2214
2215         Expanded TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm.
2216
2217         Lots of piping to allow the setting of a custom navigator platform.
2218
2219         * loader/DocumentLoader.h:
2220         (WebCore::DocumentLoader::setCustomNavigatorPlatform):
2221         (WebCore::DocumentLoader::customNavigatorPlatform const):
2222         * loader/FrameLoader.cpp:
2223         (WebCore::FrameLoader::navigatorPlatform const):
2224         * loader/FrameLoader.h:
2225         * page/Navigator.cpp:
2226         (WebCore::Navigator::platform const):
2227         * page/Navigator.h:
2228         * page/NavigatorBase.cpp:
2229         (WebCore::NavigatorBase::platform const):
2230         (WebCore::NavigatorBase::platform): Deleted.
2231         * page/NavigatorBase.h:
2232
2233 2018-12-19  Ryan Haddad  <ryanhaddad@apple.com>
2234
2235         Unreviewed, rolling out r239347.
2236
2237         Caused the leaks bot to hit an exception and the new test
2238         crashes on certain configurations.
2239
2240         Reverted changeset:
2241
2242         "Synchronous media query evaluation could destroy current
2243         Frame/FrameView."
2244         https://bugs.webkit.org/show_bug.cgi?id=192781
2245         https://trac.webkit.org/changeset/239347
2246
2247 2018-12-19  Truitt Savell  <tsavell@apple.com>
2248
2249         Unreviewed, rolling out r239358.
2250
2251         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
2252         crash on Debug bots
2253
2254         Reverted changeset:
2255
2256         "Clean up IndexedDB files between tests"
2257         https://bugs.webkit.org/show_bug.cgi?id=192796
2258         https://trac.webkit.org/changeset/239358
2259
2260 2018-12-19  Don Olmstead  <don.olmstead@sony.com>
2261
2262         Sync some include directories in WebCore
2263         https://bugs.webkit.org/show_bug.cgi?id=192819
2264
2265         Reviewed by Michael Catanzaro.
2266
2267         Added missing include directories around features that have only been enabled on
2268         Apple ports. Removes obsolete directories from list and moves harfbuzz directories
2269         into the freetype cmake file.
2270
2271         * CMakeLists.txt:
2272         * platform/FreeType.cmake:
2273
2274 2018-12-19  Alicia Boya García  <aboya@igalia.com>
2275
2276         [MSE] Remove unused method: stopAskingForMoreSamples()
2277         https://bugs.webkit.org/show_bug.cgi?id=192754
2278
2279         Reviewed by Xabier Rodriguez-Calvar.
2280
2281         The stopAskingForMoreSamples() method from SourceBufferPrivate is not
2282         being used by anyone. SourceBuffer is not calling it and no
2283         SourceBufferPrivate is implementing it. Let's remove that noise.
2284
2285         * platform/graphics/SourceBufferPrivate.h:
2286         (WebCore::SourceBufferPrivate::setActive):
2287         (WebCore::SourceBufferPrivate::stopAskingForMoreSamples): Deleted.
2288         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2289         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Deleted.
2290         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2291
2292 2018-12-19  Alicia Boya García  <aboya@igalia.com>
2293
2294         [MSE] Remove dead code: sourceBufferPrivateSeekToTime()
2295         https://bugs.webkit.org/show_bug.cgi?id=192827
2296
2297         Reviewed by Xabier Rodriguez-Calvar.
2298
2299         This patch makes two dead code removal changes in
2300         SourceBufferPrivateClient:
2301
2302         First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
2303         virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
2304         is only inherited by SourceBuffer, it makes no sense to have default
2305         implementations there (they will never be used), moreso it being a
2306         client interface.
2307
2308         Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
2309         to had an empty implementation, which SourceBuffer did not overwrite,
2310         therefore making any calls to it useless.
2311
2312         All calls to sourceBufferPrivateSeekToTime() have been removed:
2313
2314         SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
2315         itself, used to call this method. This patch deletes it completely.
2316
2317         MockSourceBufferPrivate::seekToTime(), which only called this empty
2318         method, has also been removed along with its only usage in
2319         MockMediaSourcePrivate::seekToTime().
2320
2321         * platform/graphics/SourceBufferPrivateClient.h:
2322         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
2323         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
2324         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2325         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2326         (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
2327         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
2328         (WebCore::MockMediaSourcePrivate::seekToTime):
2329         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2330         (WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
2331         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2332
2333 2018-12-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2334
2335         [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional
2336         https://bugs.webkit.org/show_bug.cgi?id=192815
2337
2338         Reviewed by Jer Noble.
2339
2340         https://www.w3.org/TR/encrypted-media/#dom-mediakeysystemconfiguration
2341         says that distinctiveIdentifier and persistentState default to
2342         optional. Our implementation does not define a default leaving it
2343         to the first option of the enum, which currently is Required.
2344
2345         * platform/encryptedmedia/CDMKeySystemConfiguration.h:
2346
2347 2018-12-19  Rob Buis  <rbuis@igalia.com>
2348
2349         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
2350         https://bugs.webkit.org/show_bug.cgi?id=192288
2351
2352         Reviewed by Frédéric Wang.
2353
2354         Prefer return value to out parameter for parseAccessControlAllowList.
2355
2356         * loader/CrossOriginPreflightResultCache.cpp:
2357         (WebCore::CrossOriginPreflightResultCacheItem::parse):
2358         * platform/network/HTTPParsers.h:
2359         (WebCore::parseAccessControlAllowList):
2360         * platform/network/ResourceResponseBase.cpp:
2361         (WebCore::ResourceResponseBase::filter):
2362         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2363
2364 2018-12-18  Zan Dobersek  <zdobersek@igalia.com>
2365
2366         REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
2367         https://bugs.webkit.org/show_bug.cgi?id=192230
2368
2369         Reviewed by Carlos Garcia Campos.
2370
2371         Single tile can after r235165 be assigned multiple content updates
2372         without a commit occurring between each update, whereas before these
2373         commits were done for each update.
2374
2375         To avoid repeating updates for a single tile purging information about
2376         the previous update, these updates are now accumulated inside a Vector
2377         and then iterated over during the commit phase.
2378
2379         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
2380         (WebCore::CoordinatedBackingStoreTile::addUpdate):
2381         (WebCore::CoordinatedBackingStoreTile::swapBuffers):
2382         (WebCore::CoordinatedBackingStore::updateTile):
2383         (WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted.
2384         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
2385         (WebCore::CoordinatedBackingStoreTile::scale const):
2386
2387 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2388
2389         [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
2390         https://bugs.webkit.org/show_bug.cgi?id=192842
2391         <rdar://problem/46823586>
2392
2393         Reviewed by Tim Horton.
2394
2395         Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
2396         registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
2397         inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
2398         this is internally tracked in <rdar://problem/46830277>.
2399
2400         * platform/ios/PlatformPasteboardIOS.mm:
2401         (WebCore::PlatformPasteboard::write):
2402
2403 2018-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2404
2405         Unreviewed, add a missing UNUSED_PARAM()
2406
2407         * Modules/mediarecorder/MediaRecorder.cpp:
2408         (WebCore::MediaRecorder::getPrivateImpl):
2409
2410 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
2411
2412         Update CSS Properties and Values API to use new cycle fallback behaviour
2413         https://bugs.webkit.org/show_bug.cgi?id=192800
2414
2415         Reviewed by Antti Koivisto.
2416
2417         Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
2418         wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. 
2419
2420         * css/CSSCustomPropertyValue.h:
2421         * css/CSSVariableReferenceValue.cpp:
2422         (WebCore::resolveVariableReference):
2423         * css/DOMCSSRegisterCustomProperty.cpp:
2424         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2425         * css/StyleResolver.cpp:
2426         (WebCore::StyleResolver::applyCascadedCustomProperty):
2427         * css/parser/CSSPropertyParser.cpp:
2428         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
2429
2430 2018-12-18  Daniel Bates  <dabates@apple.com>
2431
2432         Wrong value for key property in keydown and keyup events generated holding Control key
2433         https://bugs.webkit.org/show_bug.cgi?id=192788
2434         <rdar://problem/46795214>
2435
2436         Reviewed by Wenson Hsieh.
2437
2438         Similar to what we do on Mac, compute the DOM key property from the characters ignoring
2439         modifier keys input string when the Control key is held down.
2440
2441         * platform/ios/PlatformEventFactoryIOS.mm:
2442         (WebCore::keyForKeyEvent):
2443         * platform/mac/PlatformEventFactoryMac.mm:
2444         (WebCore::keyForKeyEvent):
2445
2446 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
2447
2448         Clean up IndexedDB files between tests
2449         https://bugs.webkit.org/show_bug.cgi?id=192796
2450
2451         Reviewed by Geoffrey Garen.
2452
2453         We should clean up the IndexedDB files between tests to make sure each test is independent of others.
2454
2455         This patch also fixes some issues in IDB.
2456
2457         Covered by existing tests.
2458
2459         * Modules/indexeddb/server/IDBServer.cpp:
2460         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
2461         We should shut down all open databases instead of databases from open database connections before deleting 
2462         files, because database starts accessing files before connection to database is established.
2463
2464         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2465         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
2466         We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase 
2467         and UniqueIDBDatabase can be destructed after shutdown.
2468
2469         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2470         didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be 
2471         invoked during the hard close.
2472
2473         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
2474         Tasks like didOpenBackingStore could be posted from database thread to main thread after 
2475         immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any 
2476         database operation. 
2477
2478         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
2479         performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access 
2480         m_backingStore when m_backingStore may already be deleted. 
2481
2482         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2483         immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort. 
2484         m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in 
2485         transactionCompleted, so they do not need to be cleared here.
2486
2487 2018-12-18  Myles C. Maxfield  <mmaxfield@apple.com>
2488
2489         Thick overlines and line-throughs grow in the wrong direction
2490         https://bugs.webkit.org/show_bug.cgi?id=192264
2491
2492         Reviewed by Dean Jackson.
2493
2494         Overlines should grow upward, and line-throughs should stay centered.
2495
2496         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
2497
2498         * rendering/TextDecorationPainter.cpp:
2499         (WebCore::TextDecorationPainter::paintTextDecoration):
2500         * style/InlineTextBoxStyle.cpp:
2501         (WebCore::visualOverflowForDecorations):
2502
2503 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
2504
2505         Some iOS app crash in FrameLoader::checkCompleted
2506         https://bugs.webkit.org/show_bug.cgi?id=192804
2507         <rdar://problem/44240573>
2508
2509         Reviewed by Tim Horton.
2510
2511         It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
2512         is trying to send a delegate message. Disable the release assertion while this is happening
2513         so that iOS app would not crash.
2514
2515         Unfortunately no new test as there is no way to easily test UIWebView in iOS,
2516         and this requires a race between the web thread & the main thread.
2517
2518         * dom/ScriptDisallowedScope.h:
2519         (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
2520         * platform/ios/wak/WebCoreThread.h:
2521         * platform/ios/wak/WebCoreThread.mm:
2522         (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
2523         (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
2524         (SendDelegateMessage):
2525
2526 2018-12-18  David Kilzer  <ddkilzer@apple.com>
2527
2528         clang-tidy: Use const reference for MediaTime parameter to prevent object copy
2529         <https://webkit.org/b/192814>
2530
2531         Reviewed by Mark Lam.
2532
2533         * bindings/js/JSDOMConvertNumbers.h:
2534         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
2535
2536 2018-12-18  Justin Fan  <justin_fan@apple.com>
2537
2538         [WebGPU] BindGroupLayout and Device::createBindGroupLayout
2539         https://bugs.webkit.org/show_bug.cgi?id=192817
2540
2541         Reviewed by Dean Jackson.
2542
2543         Update bind-group-layouts to test new functionality.
2544
2545         Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
2546         * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
2547         (WebCore::WebGPUBindGroupLayout::create):
2548         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
2549         * Modules/webgpu/WebGPUBindGroupLayout.h: Added.
2550         * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
2551         * Modules/webgpu/WebGPUDevice.cpp:
2552         (WebCore::WebGPUDevice::createBindGroupLayout const): Added.
2553         * Modules/webgpu/WebGPUDevice.h:
2554         * Modules/webgpu/WebGPUDevice.idl:
2555         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
2556         (WebCore::GPUBindGroupLayout::tryCreate):
2557         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2558         * platform/graphics/gpu/GPUBindGroupLayout.h: Added.
2559         * platform/graphics/gpu/GPUDevice.cpp:
2560         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
2561         * platform/graphics/gpu/GPUDevice.h:
2562
2563         Add files and symbols to project:
2564         * CMakeLists.txt:
2565         * DerivedSources.make:
2566         * Sources.txt:
2567         * WebCore.xcodeproj/project.pbxproj:
2568         * bindings/js/WebCoreBuiltinNames.h:
2569
2570         Missing includes that were previously provided via UnifiedSources:
2571         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
2572         * platform/sql/SQLiteFileSystem.h:
2573
2574 2018-12-18  Youenn Fablet  <youenn@apple.com>
2575
2576         Make ReadableStreamXX constructs use PrivateIdentifier
2577         https://bugs.webkit.org/show_bug.cgi?id=192771
2578
2579         Reviewed by Chris Dumez.
2580
2581         PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
2582         Covered by existing binding tests.
2583
2584         * Modules/streams/ReadableByteStreamController.idl:
2585         * Modules/streams/ReadableStreamBYOBReader.idl:
2586         * Modules/streams/ReadableStreamBYOBRequest.idl:
2587         * Modules/streams/ReadableStreamDefaultController.idl:
2588         * Modules/streams/ReadableStreamDefaultReader.idl:
2589         * bindings/scripts/CodeGeneratorJS.pm:
2590         (NeedsConstructorProperty):
2591         * bindings/scripts/preprocess-idls.pl:
2592         (shouldExposeInterface):
2593         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
2594         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
2595         * bindings/scripts/test/TestCustomConstructor.idl: Removed.
2596
2597 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2598
2599         Synchronous media query evaluation could destroy current Frame/FrameView.
2600         https://bugs.webkit.org/show_bug.cgi?id=192781
2601         <rdar://problem/34416793>
2602
2603         Reviewed by Chris Dumez.
2604
2605         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
2606
2607         Test: printing/print-with-media-query-destory.html
2608
2609         * loader/DocumentLoader.cpp:
2610         (WebCore::DocumentLoader::finishedLoading):
2611         * page/Frame.cpp:
2612         (WebCore::Frame::setPrinting):
2613         * page/FrameView.cpp:
2614         (WebCore::FrameView::forceLayoutForPagination):
2615
2616 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
2617
2618         Web Inspector: m3u8 content not shown, it should be text
2619         https://bugs.webkit.org/show_bug.cgi?id=192731
2620         <rdar://problem/46747728>
2621
2622         Reviewed by Devin Rousso.
2623
2624         * inspector/NetworkResourcesData.cpp:
2625         (WebCore::NetworkResourcesData::setResourceContent):
2626         Don't clobber data if setting empty content on a resource that has content.
2627
2628         * inspector/agents/InspectorNetworkAgent.cpp:
2629         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
2630         Additional non-"text/" mime types that can be treated as text.
2631
2632         * platform/MIMETypeRegistry.cpp:
2633         (WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
2634         * platform/MIMETypeRegistry.h:
2635         Detect media playlist mime types that are text (m3u8/m3u).
2636
2637 2018-12-18  Daniel Bates  <dabates@apple.com>
2638
2639         Remove <meta http-equiv=set-cookie> support
2640         https://bugs.webkit.org/show_bug.cgi?id=185077
2641         <rdar://problem/41791397>
2642
2643         Reviewed by Brent Fulgham.
2644
2645         Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
2646         the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
2647         removed support for this pragma and Firefox has an open bug to remove it.
2648
2649         * dom/Document.cpp:
2650         (WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
2651         was ignored instead of setting the cookie.
2652         * html/parser/XSSAuditor.cpp:
2653         (WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
2654         as dangerous and erase attribute http-equiv when we find it because we no longer honor
2655         this pragma.
2656
2657 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
2658
2659         CSS Typed OM should expose attributeStyleMap
2660         https://bugs.webkit.org/show_bug.cgi?id=192671
2661
2662         Reviewed by Ryosuke Niwa.
2663
2664         Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
2665         TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.
2666
2667         Test: css-typedom/attributeStyleMap.html
2668
2669         * CMakeLists.txt:
2670         * DerivedSources.make:
2671         * Sources.txt:
2672         * WebCore.xcodeproj/project.pbxproj:
2673         * bindings/js/WebCoreBuiltinNames.h:
2674         * css/ElementCSSInlineStyle.idl:
2675         * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
2676         * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
2677         * css/typedom/StylePropertyMapReadOnly.cpp: Added.
2678         (WebCore::StylePropertyMapReadOnly::reifyValue):
2679         (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
2680         * css/typedom/StylePropertyMapReadOnly.h:
2681         (WebCore::StylePropertyMapReadOnly::create): Deleted.
2682         (WebCore::StylePropertyMapReadOnly::get const): Deleted.
2683         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
2684         * css/typedom/StylePropertyMapReadOnly.idl:
2685         * css/typedom/TypedOMCSSImageValue.h:
2686         * dom/Element.cpp:
2687         (WebCore::Element::attributeStyleMap):
2688         (WebCore::Element::setAttributeStyleMap):
2689         * dom/Element.h:
2690         * dom/ElementRareData.cpp:
2691         * dom/ElementRareData.h:
2692         (WebCore::ElementRareData::attributeStyleMap):
2693         (WebCore::ElementRareData::setAttributeStyleMap):
2694         * dom/StyledElement.cpp:
2695         (WebCore::StyledElement::ensureAttributeStyleMap):
2696         * dom/StyledElement.h:
2697         * html/canvas/CanvasRenderingContext2DBase.cpp:
2698         (WebCore::size):
2699         (WebCore::CanvasRenderingContext2DBase::drawImage):
2700         * platform/graphics/CustomPaintImage.cpp:
2701         (WebCore::extractComputedProperty):
2702         (WebCore::CustomPaintImage::doCustomPaint):
2703
2704 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2705
2706         Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
2707         https://bugs.webkit.org/show_bug.cgi?id=192785
2708         <rdar://problem/45321184>
2709
2710         Reviewed by Tim Horton.
2711
2712         Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
2713         currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
2714         need to know when the user is typing in a text form control, but the page is preventing default text insertion
2715         behavior and instead updating values programmatically.
2716
2717         Test: fast/forms/call-text-did-change-in-text-field-when-typing.html
2718
2719         * html/TextFieldInputType.cpp:
2720         (WebCore::TextFieldInputType::setValue):
2721
2722 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2723
2724         [LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
2725         https://bugs.webkit.org/show_bug.cgi?id=192801
2726
2727         Reviewed by Antti Koivisto.
2728
2729         * layout/blockformatting/BlockFormattingContext.h:
2730         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2731         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2732         * layout/blockformatting/BlockMarginCollapse.cpp:
2733         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
2734
2735 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2736
2737         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
2738         https://bugs.webkit.org/show_bug.cgi?id=192799
2739
2740         Reviewed by Antti Koivisto.
2741
2742         * layout/blockformatting/BlockFormattingContext.h:
2743         * layout/blockformatting/BlockMarginCollapse.cpp:
2744         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
2745         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2746
2747 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2748
2749         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
2750         https://bugs.webkit.org/show_bug.cgi?id=192798
2751
2752         Reviewed by Antti Koivisto.
2753
2754         * layout/blockformatting/BlockFormattingContext.h:
2755         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2756         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2757         * layout/blockformatting/BlockMarginCollapse.cpp:
2758         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
2759         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
2760         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2761         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2762
2763 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2764
2765         [LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
2766         https://bugs.webkit.org/show_bug.cgi?id=192794
2767
2768         Reviewed by Antti Koivisto.
2769
2770         * layout/blockformatting/BlockFormattingContext.h:
2771         * layout/blockformatting/BlockMarginCollapse.cpp:
2772         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
2773         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
2774         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2775
2776 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2777
2778         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
2779         https://bugs.webkit.org/show_bug.cgi?id=192791
2780
2781         Reviewed by Antti Koivisto.
2782
2783         * layout/blockformatting/BlockMarginCollapse.cpp:
2784         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
2785         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
2786
2787 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2788
2789         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
2790         https://bugs.webkit.org/show_bug.cgi?id=192787
2791
2792         Reviewed by Antti Koivisto.
2793
2794         * layout/blockformatting/BlockFormattingContext.h:
2795         * layout/blockformatting/BlockMarginCollapse.cpp:
2796         (WebCore::Layout::hasClearance):
2797         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
2798         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
2799         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
2800         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2801
2802 2018-12-17  Fujii Hironori  <Hironori.Fujii@sony.com>
2803
2804         [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
2805         https://bugs.webkit.org/show_bug.cgi?id=192752
2806
2807         Reviewed by Don Olmstead.
2808
2809         No new tests, no behavior changes.
2810
2811         * platform/graphics/win/DIBPixelData.cpp:
2812         Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
2813         * platform/graphics/win/FontPlatformDataWin.cpp:
2814         (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
2815         * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
2816         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2817         Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
2818         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
2819         Reorder the initializer list.
2820         (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
2821         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
2822         (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
2823         (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
2824         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
2825         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
2826         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
2827         (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
2828         * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
2829         (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
2830         (WebCore::Font::boundsForGDIGlyph const): Ditto.
2831         (WebCore::Font::widthForGDIGlyph const): Ditto.
2832         * platform/graphics/win/UniscribeController.cpp:
2833         (WebCore::UniscribeController::UniscribeController):
2834         Reorder the initializer list.
2835         (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
2836         (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.
2837
2838 2018-12-17  Eric Carlson  <eric.carlson@apple.com>
2839
2840         [MediaStream] A stream's first video frame should be rendered
2841         https://bugs.webkit.org/show_bug.cgi?id=192629
2842         <rdar://problem/46664353>
2843
2844         Reviewed by Youenn Fablet.
2845
2846         Test: fast/mediastream/media-stream-renders-first-frame.html
2847
2848         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2849         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2850         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2851         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2852         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
2853         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
2854         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
2855         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
2856         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
2857         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
2858         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
2859         * platform/mediastream/RealtimeMediaSource.cpp:
2860         (WebCore::RealtimeMediaSource::size const):
2861         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2862         (WebCore::AVVideoCaptureSource::processNewFrame):
2863         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2864         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
2865
2866 2018-12-17  Justin Michaud  <justin_michaud@apple.com>
2867
2868         Bindings generator should support Conditional= along with CachedAttribute
2869         https://bugs.webkit.org/show_bug.cgi?id=192721
2870
2871         Reviewed by Ryosuke Niwa.
2872
2873         Fix a bug where specifying both attributes causes compilation errors because the compile-time
2874         condition is not included in the derived code.
2875
2876         * bindings/scripts/CodeGeneratorJS.pm:
2877         (GenerateImplementation):
2878         * bindings/scripts/test/JS/JSTestObj.cpp:
2879         (WebCore::jsTestObjCachedAttribute3Getter):
2880         (WebCore::jsTestObjCachedAttribute3):
2881         (WebCore::JSTestObj::visitChildren):
2882         * bindings/scripts/test/JS/JSTestObj.h:
2883         * bindings/scripts/test/TestObj.idl:
2884
2885 2018-12-17  David Kilzer  <ddkilzer@apple.com>
2886
2887         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
2888         <https://webkit.org/b/192707>
2889         <rdar://problem/46734926>
2890
2891         Reviewed by Daniel Bates.
2892
2893         * platform/CPUMonitor.cpp:
2894         (WebCore::CPUMonitor::setCPULimit):
2895         * platform/CPUMonitor.h:
2896         (WebCore::CPUMonitor::setCPULimit):
2897         - Change parameter to const reference to fix unnecessary copies.
2898
2899 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
2900
2901         offsetLeft and offsetParent should adjust across shadow boundaries
2902         https://bugs.webkit.org/show_bug.cgi?id=157437
2903         <rdar://problem/26154021>
2904
2905         Reviewed by Simon Fraser.
2906
2907         Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
2908         the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
2909         and https://github.com/w3c/webcomponents/issues/763
2910
2911         The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
2912         In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
2913         the one which is in the same tree as a shadow-inclusive ancestor of the context object.
2914
2915         For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
2916         inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
2917         then its offset parent, etc... until we find the offset parent in the same tree as the context object.
2918
2919         Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
2920         (e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
2921         the same tree as the context object but as well as any offset parent which is in its ancestor trees.
2922
2923         Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html
2924
2925         * dom/Element.cpp:
2926         (WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
2927         (WebCore::collectAncestorTreeScopeAsHashSet): Added.
2928         (WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
2929         which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
2930         (WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
2931         (WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
2932         until it finds the first offset parent which is a shadow-including ancestor.
2933         (WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
2934         (WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
2935         functions meant to be used for bindings code.
2936         * dom/Element.h:
2937         * html/HTMLElement.idl:
2938
2939 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
2940
2941         Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
2942         https://bugs.webkit.org/show_bug.cgi?id=192780
2943         rdar://problem/43394387
2944
2945         Reviewed by Tim Horton.
2946         
2947         macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
2948         memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.
2949         
2950         Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
2951         and consult it when making decisions that affect layer backing store format.
2952
2953         Tested by new results for existing tests.
2954
2955         * platform/graphics/FontCascade.cpp:
2956         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
2957         * platform/graphics/FontCascade.h:
2958         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2959         (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
2960         it once.
2961         * rendering/RenderLayerBacking.cpp:
2962         (WebCore::RenderLayerBacking::updateAfterDescendants):
2963         * testing/Internals.cpp:
2964         (WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::
2965
2966 2018-12-17  Daniel Bates  <dabates@apple.com>
2967
2968         Make DocumentMarker::allMarkers() constexpr
2969         https://bugs.webkit.org/show_bug.cgi?id=192634
2970
2971         Reviewed by Simon Fraser.
2972
2973         The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
2974         it constexpr to do just that.
2975
2976         * dom/DocumentMarker.h:
2977         (WebCore::DocumentMarker::allMarkers):
2978
2979 2018-12-17  Justin Fan  <justin_fan@apple.com>
2980
2981         [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
2982         https://bugs.webkit.org/show_bug.cgi?id=192726
2983
2984         Reviewed by Myles C. Maxfield.
2985
2986         Test: webgpu/bind-group-layouts.html
2987         Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
2988         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
2989         * Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
2990         * Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
2991         * Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
2992         * Modules/webgpu/WebGPUShaderStageBit.h: Added.
2993         * Modules/webgpu/WebGPUShaderStageBit.idl: Added.
2994         * platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
2995         * platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.
2996
2997         Add the new symbols and files to the project:
2998         * CMakeLists.txt:
2999         * DerivedSources.make:
3000         * Sources.txt:
3001         * WebCore.xcodeproj/project.pbxproj:
3002         * bindings/js/WebCoreBuiltinNames.h:
3003
3004         Small FIXME update for later:
3005         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3006         (WebCore::GPURenderPassEncoder::setVertexBuffers):
3007
3008 2018-12-17  Zalan Bujtas  <zalan@apple.com>
3009
3010         Unreviewed build fix.
3011
3012         * page/ios/FrameIOS.mm:
3013         (WebCore::Frame::interpretationsForCurrentRoot const):
3014
3015 2018-12-17  Zalan Bujtas  <zalan@apple.com>
3016
3017         Reproducible ASSERTion failure when toggling layer borders with find-in-page up
3018         https://bugs.webkit.org/show_bug.cgi?id=192762
3019         <rdar://problem/46676873>
3020
3021         Reviewed by Simon Fraser.
3022
3023         DocumentMarkerController::markersFor() should take a reference instead of a Node*.
3024
3025         Test: editing/document-marker-null-check.html
3026
3027         * dom/DocumentMarkerController.cpp:
3028         (DocumentMarkerController::hasMarkers):
3029         * dom/DocumentMarkerController.h:
3030         * editing/AlternativeTextController.cpp:
3031         (WebCore::AlternativeTextController::respondToChangedSelection):
3032         * editing/Editor.cpp:
3033         (WebCore::Editor::selectionStartHasMarkerFor const):
3034         * rendering/InlineTextBox.cpp:
3035         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
3036         * rendering/RenderReplaced.cpp:
3037         (WebCore::RenderReplaced::paint):
3038         * rendering/RenderText.cpp:
3039         (WebCore::RenderText::draggedContentRangesBetweenOffsets const):
3040         * rendering/SimpleLineLayout.cpp:
3041         (WebCore::SimpleLineLayout::canUseForWithReason):
3042         * testing/Internals.cpp:
3043         (WebCore::Internals::markerCountForNode):
3044
3045 2018-12-17  Commit Queue  <commit-queue@webkit.org>
3046
3047         Unreviewed, rolling out r239265 and r239274.
3048         https://bugs.webkit.org/show_bug.cgi?id=192765
3049
3050         unorm_normalize is deprecated, and broke an internal build
3051         (Requested by Truitt on #webkit).
3052
3053         Reverted changesets:
3054
3055         "[GTK][WPE] Need a function to convert internal URI to display
3056         ("pretty") URI"
3057         https://bugs.webkit.org/show_bug.cgi?id=174816
3058         https://trac.webkit.org/changeset/239265
3059
3060         "Fix the Apple Internal Mac build with a newer SDK"
3061         https://trac.webkit.org/changeset/239274
3062
3063 2018-12-17  Daniel Bates  <dabates@apple.com>
3064
3065         [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
3066         https://bugs.webkit.org/show_bug.cgi?id=192633
3067
3068         Reviewed by Wenson Hsieh.
3069
3070         UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
3071         input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
3072         for binary compatibility.
3073
3074         * platform/ios/WebEvent.h:
3075         * platform/ios/WebEvent.mm:
3076         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.
3077
3078 2018-12-17  Matt Lewis  <jlewis3@apple.com>
3079
3080         Unreviewed, rolling out r239254.
3081
3082         This broke the Windows 10 Debug build
3083
3084         Reverted changeset:
3085
3086         "Replace many uses of String::format with more type-safe
3087         alternatives"
3088         https://bugs.webkit.org/show_bug.cgi?id=192742
3089         https://trac.webkit.org/changeset/239254
3090
3091 2018-12-17  Antoine Quint  <graouts@apple.com>
3092
3093         [Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
3094         https://bugs.webkit.org/show_bug.cgi?id=192758
3095
3096         Reviewed by Dean Jackson.
3097
3098         We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
3099         gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
3100         less bookkeeping to perform.
3101
3102         No new test since there is no user-observable change.
3103
3104         * animation/WebAnimation.cpp:
3105         (WebCore::WebAnimation::updateFinishedState):
3106         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
3107         (WebCore::WebAnimation::performMicrotask): Deleted.
3108         * animation/WebAnimation.h:
3109
3110 2018-12-17  Antoine Quint  <graouts@apple.com>
3111
3112         [Web Animations] Ensure we don't update an animation's finished state twice when updating animations
3113         https://bugs.webkit.org/show_bug.cgi?id=192757
3114
3115         Reviewed by Dean Jackson.
3116
3117         When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
3118         twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
3119         whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
3120         next call to resolve(), unless any of the timing properties have changed in the meantime.
3121
3122         No new test since there is no user-observable change.
3123
3124         * animation/WebAnimation.cpp:
3125         (WebCore::WebAnimation::timingDidChange):
3126         (WebCore::WebAnimation::tick):
3127         (WebCore::WebAnimation::resolve):
3128         * animation/WebAnimation.h:
3129
3130 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
3131
3132         REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
3133         https://bugs.webkit.org/show_bug.cgi?id=192725
3134         rdar://problem/46011418
3135
3136         Reviewed by Antoine Quint.
3137
3138         There were two problems with backing store attachment and animation.
3139         
3140         First, animations are an input into the "backing store attached" logic, so when they change
3141         we should set the CoverageRectChanged bit on GraphicsLayerCA.
3142         
3143         Secondly, when an ancestor has unknown animation extent, all its descendants need to
3144         get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
3145         the current layer has no animation extent.
3146
3147         Tests: compositing/backing/animate-into-view-with-descendant.html
3148                compositing/backing/animate-into-view.html
3149
3150         * platform/graphics/ca/GraphicsLayerCA.cpp:
3151         (WebCore::GraphicsLayerCA::addAnimation):
3152         (WebCore::GraphicsLayerCA::removeAnimation):
3153         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
3154
3155 2018-12-17  Zalan Bujtas  <zalan@apple.com>
3156
3157         [LFC][BFC][MarginCollapsing] Unify margin collapse function naming
3158         https://bugs.webkit.org/show_bug.cgi?id=192747
3159
3160         Reviewed by Antti Koivisto.
3161
3162         Rename some margin collapse getters.
3163
3164         * layout/blockformatting/BlockFormattingContext.h:
3165         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3166         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3167         * layout/blockformatting/BlockMarginCollapse.cpp:
3168         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
3169         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
3170         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
3171         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
3172         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
3173         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
3174         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
3175         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
3176         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
3177         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
3178         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
3179         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
3180         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
3181         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
3182         (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
3183         (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
3184         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
3185         (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
3186         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
3187         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.
3188
3189 2018-12-17  David Kilzer  <ddkilzer@apple.com>
3190
3191         clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
3192         <https://webkit.org/b/192751>
3193         <rdar://problem/46771623>
3194
3195         Reviewed by Daniel Bates.
3196
3197         Change loop variables to const references to avoid unnecessary
3198         copies.
3199
3200         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3201         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3202         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3203         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
3204         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3205         (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
3206         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3207         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
3208         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
3209         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
3210         (WebCore::IDBDatabaseInfo::loggingString const):
3211         * Modules/mediasource/SourceBuffer.cpp:
3212         (WebCore::removeSamplesFromTrackBuffer):
3213         * accessibility/AccessibilityRenderObject.cpp:
3214         (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
3215         * accessibility/AccessibilityTableRow.cpp:
3216         (WebCore::AccessibilityTableRow::headerObject):
3217         * animation/KeyframeEffect.cpp:
3218         (WebCore::KeyframeEffect::computedNeedsForcedLayout):
3219         * crypto/keys/CryptoKeyRSA.cpp:
3220         (WebCore::CryptoKeyRSA::importJwk):
3221         (WebCore::CryptoKeyRSA::exportJwk const):
3222         * css/CSSComputedStyleDeclaration.cpp:
3223         (WebCore::OrderedNamedLinesCollector::appendLines const):
3224         * dom/DataTransfer.cpp:
3225         (WebCore::readURLsFromPasteboardAsString):
3226         * dom/TreeScope.cpp:
3227         (WebCore::TreeScope::elementsFromPoint):
3228         * html/track/WebVTTParser.cpp:
3229         (WebCore::WebVTTParser::checkAndStoreRegion):
3230         * inspector/agents/InspectorTimelineAgent.cpp:
3231         (WebCore::InspectorTimelineAgent::setInstruments):
3232         * page/Page.cpp:
3233         (WebCore::Page::updateIntersectionObservations):
3234         * page/TextIndicator.cpp:
3235         (WebCore::estimatedBackgroundColorForRange):
3236         * page/animation/KeyframeAnimation.cpp:
3237         (WebCore::KeyframeAnimation::computeLayoutDependency):
3238         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3239         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3240         * platform/graphics/ca/GraphicsLayerCA.cpp:
3241         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
3242         (WebCore::GraphicsLayerCA::updateAnimations):
3243         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
3244         * platform/graphics/mac/ImageMac.mm:
3245         (WebCore::BitmapImage::tiffRepresentation):
3246         * rendering/HitTestResult.cpp:
3247         (WebCore::HitTestResult::append):
3248         * testing/Internals.cpp:
3249         (WebCore::Internals::acceleratedAnimationsForElement):
3250
3251 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
3252
3253         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
3254         https://bugs.webkit.org/show_bug.cgi?id=174816
3255
3256         Reviewed by Michael Catanzaro.
3257
3258         Tests: enabled fast/url/user-visible/.
3259
3260         * testing/Internals.cpp:
3261         (WebCore::Internals::userVisibleString): Enable method on all platforms.
3262
3263 2018-12-15  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3264
3265         Null pointer dereference in JSC::WriteBarrierBase()
3266         https://bugs.webkit.org/show_bug.cgi?id=191252
3267
3268         Reviewed by Keith Miller.
3269
3270         * bindings/js/JSCustomElementRegistryCustom.cpp:
3271         (WebCore::JSCustomElementRegistry::whenDefined):
3272         * bindings/js/JSDOMPromiseDeferred.cpp:
3273         (WebCore::createDeferredPromise):
3274         * bindings/js/JSDOMPromiseDeferred.h:
3275         (WebCore::DeferredPromise::create):
3276         (WebCore::callPromiseFunction):
3277         * bindings/js/JSDOMWindowBase.cpp:
3278         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
3279         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
3280         * bindings/js/ScriptModuleLoader.cpp:
3281         (WebCore::ScriptModuleLoader::fetch):
3282         (WebCore::rejectPromise):
3283
3284 2018-12-15  Darin Adler  <darin@apple.com>
3285
3286         Use warning-ignoring macros more consistently and simply
3287         https://bugs.webkit.org/show_bug.cgi?id=192743
3288
3289         Reviewed by Mark Lam.
3290
3291         * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
3292         IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
3293         files like this one with non-clang compilers, and no need to worry about
3294         them when choosing the macro.
3295
3296         * crypto/mac/CryptoKeyRSAMac.cpp:
3297         (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3298
3299         * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
3300         the "unknown-pragmas" trick, which the macro should take care of.
3301         * css/makevalues.pl: Ditto.
3302         * platform/ColorData.gperf: Ditto.
3303
3304         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3305         (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
3306         (see rationale above for Objective-C++).
3307
3308         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3309         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
3310         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
3311         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3312         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
3313
3314         * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
3315         (see rationale above for Objective-C++).
3316
3317         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3318         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
3319         Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
3320
3321         * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
3322         (see rationale above for Objective-C++).
3323
3324         * platform/network/cocoa/ResourceResponseCocoa.mm:
3325         (WebCore::ResourceResponse::platformCertificateInfo const): Use
3326         ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3327
3328 2018-12-15  Darin Adler  <darin@apple.com>
3329
3330         Replace many uses of String::format with more type-safe alternatives
3331         https://bugs.webkit.org/show_bug.cgi?id=192742
3332
3333         Reviewed by Mark Lam.
3334
3335         A while back, String::format was more efficient than string concatenation,
3336         but that is no longer true, and we should prefer String::number, makeString,
3337         or concatenation with the "+" operator to String::format for new code.
3338
3339         This is not as good for programmers who are fond of printf formatting
3340         style, and in some cases it's a little harder to read the strings
3341         interspersed with variables rather than a format string, but it's better
3342         in a few ways:
3343
3344         - more efficient (I didn't measure the difference, but it's definitely
3345           slower to use String::Format which calls vsnprintf twice than to use
3346           the WTF code)
3347         - works in a type-safe way without a need to use a format specifier such
3348           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
3349           subtle differences between platforms
3350         - allows us to use StringView in some cases to sidestep the need to
3351           allocate temporary WTF::String objects
3352         - does not require converting each WTF::String to a C string, allowing
3353           us to remove many cases of ".utf8().data()" and similar expressions,
3354           eliminating the allocation of temporary WTF::CString objects
3355
3356         This patch covers a batch of easiest-to-convert call sites.
3357         Later patches will allow us to deprecate or remove String::format.
3358
3359         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3360         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
3361         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
3362         (WebCore::IDBCursorInfo::loggingString const): Ditto.
3363         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
3364         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
3365         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
3366         (WebCore::IDBGetRecordData::loggingString const): Ditto.
3367         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
3368         (WebCore::IDBIndexInfo::loggingString const): Ditto.
3369         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
3370         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
3371         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
3372         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3373         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
3374         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3375         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
3376         * Modules/webdatabase/Database.cpp:
3377         (WebCore::formatErrorMessage): Ditto.
3378         * Modules/webdatabase/SQLError.h:
3379         (WebCore::SQLError::create): Ditto.
3380
3381         * bindings/scripts/CodeGeneratorJS.pm:
3382         (GenerateImplementation): Use makeString.
3383
3384         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3385         * bindings/scripts/test/JS/JSMapLike.cpp:
3386         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3387         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3388         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3389         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3390         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3391         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3392         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3393         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3394         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3395         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3396         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3397         * bindings/scripts/test/JS/JSTestException.cpp:
3398         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3399         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3400         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3401         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3402         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3403         * bindings/scripts/test/JS/JSTestInterface.cpp:
3404         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3405         * bindings/scripts/test/JS/JSTestIterable.cpp:
3406         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3407         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3408         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3409         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3410         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3411         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3412         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3413         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3414         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3415         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3416         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3417         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3418         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3419         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3420         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3421         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3422         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3423         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3424         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3425         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3426         * bindings/scripts/test/JS/JSTestNode.cpp:
3427         * bindings/scripts/test/JS/JSTestObj.cpp:
3428         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3429         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3430         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3431         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3432         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3433         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3434         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
3435         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3436         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3437         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3438         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3439         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3440         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3441         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3442         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3443         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3444         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3445         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3446         Updated expected results.
3447 :
3448         * css/parser/CSSPropertyParserHelpers.cpp:
3449         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
3450         and makeString.
3451
3452         * html/HTMLSelectElement.cpp:
3453         (WebCore::HTMLSelectElement::setLength): Use makeString.
3454         * html/ImageDocument.cpp:
3455         (WebCore::ImageDocument::imageUpdated): Ditto.
3456         * html/parser/XSSAuditor.cpp:
3457         (WebCore::XSSAuditor::init): Ditto.
3458         * inspector/InspectorFrontendClientLocal.cpp:
3459         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
3460         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
3461         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
3462         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
3463         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
3464         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
3465         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
3466         * page/MemoryRelease.cpp:
3467         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
3468
3469         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3470         (WebCore::formatByteNumber): Use String::number.
3471         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
3472
3473         * page/cocoa/ResourceUsageThreadCocoa.mm:
3474         (WebCore::logFootprintComparison): Use makeString.
3475         * platform/animation/TimingFunction.cpp:
3476         (WebCore::TimingFunction::cssText const): Ditto.
3477
3478         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3479         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
3480         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
3481         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
3482
3483         * platform/graphics/ca/GraphicsLayerCA.cpp:
3484         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
3485         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
3486         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
3487         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
3488         * platform/mock/MockRealtimeVideoSource.cpp:
3489         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
3490
3491         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
3492
3493         * platform/network/ParsedContentRange.cpp:
3494         (WebCore::ParsedContentRange::headerValue const): Use makeString.
3495
3496         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
3497         compiler conditionals and reorganized the start/stop of namespaces.
3498         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
3499
3500         * platform/sql/SQLiteDatabase.cpp:
3501         (WebCore::unauthorizedSQLFunction): Use makeString.
3502         * rendering/RenderLayerCompositor.cpp:
3503         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
3504         * workers/service/server/RegistrationDatabase.cpp:
3505         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
3506         (WebCore::RegistrationDatabase::importRecords): Ditto.
3507
3508 2018-12-15  Youenn Fablet  <youenn@apple.com>
3509
3510         Make RTCRtpSender.setParameters to activate specific encodings
3511         https://bugs.webkit.org/show_bug.cgi?id=192732
3512
3513         Reviewed by Eric Carlson.
3514
3515         The conversion between libwebrtc and WebCore is lossy for send parameters.
3516         Libwebrtc checking the differences of values, call to setParameters will often fail.
3517
3518         Given some parameters cannot be exposed, the sender backend keeps the
3519         current set of parameters when gathered and reuses them when parameters are set.
3520
3521         For encodings, we only change activate/maxBitRate/maxFrameRate as
3522         these are the most important parameters to be able to modify.
3523
3524         Covered by added tests in webrtc/video.html.
3525
3526         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
3527         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
3528         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
3529         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
3530         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
3531         (WebCore::fromRTCRtpSendParameters):
3532         (WebCore::fromRTCEncodingParameters): Deleted.
3533         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
3534
3535 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
3536
3537         Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
3538         https://bugs.webkit.org/show_bug.cgi?id=192724
3539         <rdar://problem/46745911>
3540
3541         Reviewed by Devin Rousso.
3542
3543         iOS never installs the InspectorOverlay page as a page overlay.
3544         It also uses its own node highlighting painting. Avoid any work
3545         and resources associated with the overlay page for iOS.
3546
3547         * inspector/InspectorOverlay.cpp:
3548         (WebCore::InspectorOverlay::paint):
3549         (WebCore::InspectorOverlay::update):
3550         (WebCore::InspectorOverlay::overlayPage):
3551         (WebCore::evaluateCommandInOverlay):
3552
3553 2018-12-14  Youenn Fablet  <youenn@apple.com>
3554
3555         MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
3556         https://bugs.webkit.org/show_bug.cgi?id=192720
3557
3558         Reviewed by Eric Carlson.
3559
3560         Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
3561         as the latter is a ref counted object.
3562         Made some refactoring to return early in case of error.
3563
3564         Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
3565         the MediaRecorder will stop listening for its tracks.
3566         Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.
3567
3568         Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html
3569
3570         * Modules/mediarecorder/MediaRecorder.cpp:
3571         (WebCore::MediaRecorder::didAddOrRemoveTrack):
3572         (WebCore::MediaRecorder::setNewRecordingState): Deleted.
3573         * Modules/mediarecorder/MediaRecorder.h:
3574         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
3575         (WebCore::MediaRecorderPrivateAVFImpl::create):
3576         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
3577         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
3578         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
3579         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
3580         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
3581         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
3582         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
3583         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
3584         (WebCore::MediaRecorderPrivateWriter::create):
3585         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
3586         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
3587         (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.
3588
3589 2018-12-14  Youenn Fablet  <youenn@apple.com>
3590
3591         getSenders/getReceivers() should not return closed transceiver senders/receivers
3592         https://bugs.webkit.org/show_bug.cgi?id=192706
3593
3594         Reviewed by Eric Carlson.
3595
3596         Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
3597         This forces us to compute the sender/receiver list at getter call time.
3598         Updated the internal call sites of senders to use the list of transceivers instead.
3599
3600         Covered by updated WPT tests.
3601
3602         * Modules/mediastream/RTCPeerConnection.cpp:
3603         (WebCore::RTCPeerConnection::addTrack):
3604         (WebCore::RTCPeerConnection::getSenders const):
3605         (WebCore::RTCPeerConnection::getReceivers const):
3606         * Modules/mediastream/RTCPeerConnection.h:
3607         * Modules/mediastream/RTCRtpTransceiver.cpp:
3608         (WebCore::RTCRtpTransceiver::stopped const):
3609         (WebCore::RtpTransceiverSet::append):
3610         (WebCore::RtpTransceiverSet::senders const):
3611         (WebCore::RtpTransceiverSet::receivers const):
3612         * Modules/mediastream/RTCRtpTransceiver.h:
3613         (WebCore::RtpTransceiverSet::senders const): Deleted.
3614         (WebCore::RtpTransceiverSet::receivers const): Deleted.
3615         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3616         (WebCore::findExistingSender):
3617         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
3618
3619 2018-12-14  David Kilzer  <ddkilzer@apple.com>
3620
3621         clang-tidy: Fix unnecessary copy of objects for operator==() methods
3622         <https://webkit.org/b/192712>
3623         <rdar://problem/46739332>
3624
3625         Reviewed by Andy Estes.
3626
3627         * contentextensions/HashableActionList.h:
3628         (WebCore::ContentExtensions::HashableActionList::operator== const):
3629         (WebCore::ContentExtensions::HashableActionList::operator!= const):
3630         * platform/network/FormData.h:
3631         (WebCore::FormDataElement::EncodedFileData::operator== const):
3632         (WebCore::FormDataElement::EncodedBlobData::operator== const):
3633         - Change arguments from const to const reference to avoid
3634           copies.
3635
3636 2018-12-14  Jer Noble  <jer.noble@apple.com>
3637
3638         CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
3639         https://bugs.webkit.org/show_bug.cgi?id=192713
3640         <rdar://problem/46739706>
3641
3642         Reviewed by Eric Carlson.
3643
3644         A callback is being called twice, and the second time has a null Promise. Instead of these
3645         callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
3646         have ASSERTS() that they are called once-and-only-once.
3647
3648         * platform/encryptedmedia/CDMInstanceSession.h:
3649         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3650         (WebCore::CDMInstanceSessionClearKey::closeSession):
3651         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3652         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
3653         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
3654         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
3655         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
3656         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
3657
3658 2018-12-14  David Kilzer  <ddkilzer@apple.com>
3659
3660         clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
3661         <https://webkit.org/b/192708>
3662         <rdar://problem/46735907>
3663
3664         Reviewed by Jer Noble.
3665
3666         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3667         (WebCore::toSample):
3668         - Make argument a const reference.
3669
3670         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3671         - Update method signatures for implementation changes.
3672         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3673         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset):
3674         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
3675         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
3676         - Make RetainPtr<> argument an rvalue reference and use WTFMove().
3677         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
3678         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
3679         - Make RetainPtr<> argument a const reference.
3680
3681         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3682         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
3683         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
3684         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
3685         - Change for loop keys to be const references.
3686
3687         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3688         - Update method signatures for implementation changes.
3689         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3690         (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
3691         (WebCore::SourceBufferPrivateAVFObjC::seekToTime):
3692         - Make Mediatime arguments a const reference.
3693
3694 2018-12-14  Simon Fraser  <simon.fraser@apple.com>
3695
3696         REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear
3697         https://bugs.webkit.org/show_bug.cgi?id=188655
3698         rdar://problem/43382687
3699
3700         Reviewed by Antoine Quint.
3701
3702         The logic that computes animation extent, used by backing store attachment code, failed
3703         to account for the behavior where a keyframe animation with a missing 0% keyframe uses
3704         the transform from the unanimated style. This resulted in the computed extent being wrong,
3705         which caused us to remove the layer's backing store in some scenarios.
3706
3707         Fix both animation code paths to use the renderer style if the first keyframe doesn't
3708         contain a transform.
3709
3710         Tests: compositing/backing/backing-store-attachment-empty-keyframe.html
3711                legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html
3712
3713         * animation/KeyframeEffect.cpp:
3714         (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
3715         * page/animation/KeyframeAnimation.cpp:
3716         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
3717
3718 2018-12-14  Chris Dumez  <cdumez@apple.com>
3719
3720         [PSON] Stop exposing PolicyAction::Suspend to WebCore
3721         https://bugs.webkit.org/show_bug.cgi?id=192701
3722
3723         Reviewed by Brady Eidson.
3724
3725         Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore.
3726
3727         * loader/DocumentLoader.cpp:
3728         (WebCore::DocumentLoader::continueAfterContentPolicy):
3729         * loader/FrameLoaderTypes.h:
3730         * loader/PolicyChecker.cpp:
3731         (WebCore::PolicyChecker::checkNavigationPolicy):
3732         (WebCore::PolicyChecker::checkNewWindowPolicy):
3733
3734 2018-12-14  Youenn Fablet  <youenn@apple.com>
3735
3736         IDB should store RTCCertificate
3737         https://bugs.webkit.org/show_bug.cgi?id=192599
3738
3739         Reviewed by Brady Eidson.
3740
3741         In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate.
3742         Instead, create an empty object so that the deserialization can still succeed.
3743         This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper.
3744
3745         Test: webrtc/certificates-indexeddb.html
3746
3747         * bindings/js/SerializedScriptValue.cpp:
3748         (WebCore::CloneDeserializer::readTerminal):
3749
3750 2018-12-14  Zalan Bujtas  <zalan@apple.com>
3751
3752         [LFC][BFC] Transition to logical margin types.
3753         https://bugs.webkit.org/show_bug.cgi?id=192699
3754
3755         Reviewed by Antti Koivisto.
3756
3757         This is in preparation for moving over to logical types.
3758         (This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin))
3759
3760         * layout/FormattingContext.cpp:
3761         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
3762         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3763         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3764         * layout/FormattingContext.h:
3765         * layout/FormattingContextGeometry.cpp:
3766         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
3767         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3768         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3769         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3770         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3771         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3772         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3773         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3774         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3775         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3776         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
3777         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
3778         * layout/FormattingContextQuirks.cpp:
3779         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
3780         * layout/MarginTypes.h:
3781         (WebCore::Layout::VerticalMargin::usedValues const):
3782         * layout/Verification.cpp:
3783         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
3784         * layout/blockformatting/BlockFormattingContext.cpp:
3785         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
3786         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
3787         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
3788         (WebCore::Layout::hasPrecomputedMarginBefore):
3789         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3790         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
3791         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3792         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3793         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3794         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted.
3795         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted.
3796         (WebCore::Layout::hasPrecomputedMarginTop): Deleted.
3797         * layout/blockformatting/BlockFormattingContext.h:
3798         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3799         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3800         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3801         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
3802         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
3803         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3804         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
3805         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore):
3806         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter):
3807         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted.
3808         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted.
3809         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3810         (WebCore::Layout::hasMarginBeforeQuirkValue):
3811         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
3812         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore):
3813         (WebCore::Layout::hasMarginTopQuirkValue): Deleted.
3814         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted.
3815         * layout/blockformatting/BlockMarginCollapse.cpp:
3816         (WebCore::Layout::isMarginBeforeCollapsedWithSibling):
3817         (WebCore::Layout::isMarginAfterCollapsedWithSibling):
3818         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent):
3819         (WebCore::Layout::isMarginAfterCollapsedThrough):
3820         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
3821         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
3822         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
3823         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
3824         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
3825         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
3826         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent):
3827         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter):
3828         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
3829         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
3830         (WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted.
3831         (WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted.
3832         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted.
3833         (WebCore::Layout::isMarginBottomCollapsedThrough): Deleted.
3834         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
3835         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted.
3836         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
3837         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
3838         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted.
3839         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted.
3840         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
3841         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
3842         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
3843         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted.
3844         * layout/displaytree/DisplayBox.cpp:
3845         (WebCore::Display::Box::Box):
3846         (WebCore::Display::Box::marginBox const):
3847         (WebCore::Display::Box::nonCollapsedMarginBox const):
3848         * layout/displaytree/DisplayBox.h:
3849         (WebCore::Display::Box::rectWithMargin const):
3850         (WebCore::Display::Box::estimatedMarginBefore const):
3851         (WebCore::Display::Box::setEstimatedMarginBefore):
3852         (WebCore::Display::Box::top const):
3853         (WebCore::Display::Box::topLeft const):
3854         (WebCore::Display::Box::setVerticalMargin):
3855         (WebCore::Display::Box::marginBefore const):
3856         (WebCore::Display::Box::marginStart const):
3857         (WebCore::Display::Box::marginAfter const):
3858         (WebCore::Display::Box::marginEnd const):
3859         (WebCore::Display::Box::nonCollapsedMarginBefore const):
3860         (WebCore::Display::Box::nonCollapsedMarginAfter const):
3861         (WebCore::Display::Box::nonComputedMarginStart const):
3862         (WebCore::Display::Box::nonComputedMarginEnd const):
3863         (WebCore::Display::Box::estimatedMarginTop const): Deleted.
3864         (WebCore::Display::Box::setEstimatedMarginTop): Deleted.
3865         (WebCore::Display::Box::marginTop const): Deleted.
3866         (WebCore::Display::Box::marginLeft const): Deleted.
3867         (WebCore::Display::Box::marginBottom const): Deleted.
3868         (WebCore::Display::Box::marginRight const): Deleted.
3869         (WebCore::Display::Box::nonCollapsedMarginTop const): Deleted.
3870         (WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted.
3871         (WebCore::Display::Box::nonComputedMarginLeft const): Deleted.
3872         (WebCore::Display::Box::nonComputedMarginRight const): Deleted.
3873         * layout/floats/FloatAvoider.cpp:
3874         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
3875         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
3876         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
3877         * layout/floats/FloatAvoider.h:
3878         (WebCore::Layout::FloatAvoider::marginBefore const):
3879         (WebCore::Layout::FloatAvoider::marginAfter const):
3880         (WebCore::Layout::FloatAvoider::marginStart const):
3881         (WebCore::Layout::FloatAvoider::marginEnd const):
3882         (WebCore::Layout::FloatAvoider::marginBoxWidth const):
3883         (WebCore::Layout::FloatAvoider::marginTop const): Deleted.
3884         (WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
3885         (WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
3886         (WebCore::Layout::FloatAvoider::marginRight const): Deleted.
3887         * layout/floats/FloatBox.cpp:
3888         (WebCore::Layout::FloatBox::rect const):
3889         (WebCore::Layout::FloatBox::horizontalPositionCandidate):
3890         (WebCore::Layout::FloatBox::verticalPositionCandidate):
3891         (WebCore::Layout::FloatBox::initialVerticalPosition const):
3892         * layout/floats/FloatingContext.cpp:
3893         (WebCore::Layout::FloatingContext::positionForFloat const):
3894         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3895         * layout/inlineformatting/InlineFormattingContext.cpp:
3896         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
3897
3898 2018-12-14  Zalan Bujtas  <zalan@apple.com>
3899
3900         [LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
3901         https://bugs.webkit.org/show_bug.cgi?id=192692
3902
3903         Reviewed by Antti Koivisto.
3904
3905         This is in preparation for completing block margin collapsing.
3906
3907         * WebCore.xcodeproj/project.pbxproj:
3908         * layout/FormattingContext.cpp:
3909         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3910         * layout/FormattingContext.h:
3911         * layout/FormattingContextGeometry.cpp:
3912         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3913         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3914         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3915         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3916         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
3917         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
3918         * layout/LayoutState.cpp:
3919         (WebCore::Layout::LayoutState::LayoutState):
3920         * layout/LayoutUnits.h:
3921         (WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted.
3922         * layout/MarginTypes.h: Added.
3923         (WebCore::Layout::VerticalMargin::nonCollapsedValues const):
3924         (WebCore::Layout::VerticalMargin::collapsedValues const):
3925         (WebCore::Layout::VerticalMargin::setCollapsedValues):
3926         (WebCore::Layout::VerticalMargin::VerticalMargin):
3927         (WebCore::Layout::VerticalMargin::usedValues const):
3928         * layout/blockformatting/BlockFormattingContext.cpp:
3929         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3930         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3931         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3932         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3933         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3934         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
3935         * layout/displaytree/DisplayBox.cpp:
3936         (WebCore::Display::Box::Box):
3937         * layout/displaytree/DisplayBox.h:
3938         (WebCore::Display::Box::setHorizontalMargin):
3939         (WebCore::Display::Box::setVerticalMargin):
3940         (WebCore::Display::Box::setHorizontalNonComputedMargin):
3941         (WebCore::Display::Box::verticalMargin const):
3942         (WebCore::Display::Box::marginTop const):
3943         (WebCore::Display::Box::marginLeft const):
3944         (WebCore::Display::Box::marginBottom const):
3945         (WebCore::Display::Box::marginRight const):
3946         (WebCore::Display::Box::nonCollapsedMarginTop const):
3947         (WebCore::Display::Box::nonCollapsedMarginBottom const):
3948         (WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted.
3949         * layout/floats/FloatingContext.cpp:
3950         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3951         * layout/inlineformatting/InlineFormattingContext.cpp:
3952         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
3953
3954 2018-12-14  Fujii Hironori  <Hironori.Fujii@sony.com>
3955
3956         [Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
3957         https://bugs.webkit.org/show_bug.cgi?id=192693
3958
3959         Reviewed by Ross Kirsling.
3960
3961         No new tests, no behavior changes.
3962
3963         * platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list.
3964         * platform/win/CursorWin.cpp:
3965         (WebCore::loadCursorByName): Changed the argument type of 'name' to const char*.
3966         * platform/win/DefWndProcWindowClass.cpp:
3967         (WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'.
3968         * platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'.
3969         * platform/win/PasteboardWin.cpp:
3970         (WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'.
3971         (WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning.
3972         * platform/win/PlatformMouseEventWin.cpp:
3973         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list.
3974         * platform/win/PopupMenuWin.cpp:
3975         (WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'.
3976         * platform/win/PopupMenuWin.h: Marked override methods with 'override'.
3977         * platform/win/SSLKeyGeneratorWin.cpp:
3978         (WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in W