Unreviewed build fix.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-05-28  Zalan Bujtas  <zalan@apple.com>
2
3         Unreviewed build fix.
4
5         * layout/displaytree/DisplayBox.h:
6         (WebCore::Display::Box::Rect::operator LayoutRect const):
7
8 2018-05-28  Zalan Bujtas  <zalan@apple.com>
9
10         [LFC] Add Rect interface to Display::Box
11         https://bugs.webkit.org/show_bug.cgi?id=186019
12
13         Reviewed by Antti Koivisto.
14
15         Having a dedicated Rect class and moving the geometry invalidation to it enables us to call
16         displayBox.contentBox().left() even when the widht/height are not computed yet.
17         Also having Rect with top/left/bottom/right interface is more aligned with the rest of the layout code than x/y/maxX/maxY.
18
19         * layout/FormattingContextGeometry.cpp:
20         (WebCore::Layout::contentHeightForFormattingContextRoot):
21         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
22         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
23         * layout/displaytree/DisplayBox.cpp:
24         (WebCore::Display::Box::marginBox const):
25         (WebCore::Display::Box::borderBox const):
26         (WebCore::Display::Box::paddingBox const):
27         (WebCore::Display::Box::contentBox const):
28         * layout/displaytree/DisplayBox.h:
29         (WebCore::Display::Box::Rect::invalidateTop):
30         (WebCore::Display::Box::Rect::invalidateLeft):
31         (WebCore::Display::Box::Rect::invalidateWidth):
32         (WebCore::Display::Box::Rect::invalidateHeight):
33         (WebCore::Display::Box::Rect::hasValidPosition const):
34         (WebCore::Display::Box::Rect::hasValidSize const):
35         (WebCore::Display::Box::Rect::hasValidGeometry const):
36         (WebCore::Display::Box::rect const):
37         (WebCore::Display::Box::top const):
38         (WebCore::Display::Box::left const):
39         (WebCore::Display::Box::bottom const):
40         (WebCore::Display::Box::right const):
41         (WebCore::Display::Box::topLeft const):
42         (WebCore::Display::Box::bottomRight const):
43         (WebCore::Display::Box::size const):
44         (WebCore::Display::Box::width const):
45         (WebCore::Display::Box::height const):
46         (WebCore::Display::Box::setTopLeft):
47         (WebCore::Display::Box::setTop):
48         (WebCore::Display::Box::setLeft):
49         (WebCore::Display::Box::setWidth):
50         (WebCore::Display::Box::setHeight):
51         (WebCore::Display::Box::Rect::invalidatePosition):
52         (WebCore::Display::Box::Rect::setHasValidPosition):
53         (WebCore::Display::Box::Rect::Rect):
54         (WebCore::Display::Box::Rect::top const):
55         (WebCore::Display::Box::Rect::left const):
56         (WebCore::Display::Box::Rect::bottom const):
57         (WebCore::Display::Box::Rect::right const):
58         (WebCore::Display::Box::Rect::topLeft const):
59         (WebCore::Display::Box::Rect::bottomRight const):
60         (WebCore::Display::Box::Rect::size const):
61         (WebCore::Display::Box::Rect::width const):
62         (WebCore::Display::Box::Rect::height const):
63         (WebCore::Display::Box::Rect::setTopLeft):
64         (WebCore::Display::Box::Rect::setTop):
65         (WebCore::Display::Box::Rect::setLeft):
66         (WebCore::Display::Box::Rect::setWidth):
67         (WebCore::Display::Box::Rect::setHeight):
68         (WebCore::Display::Box::Rect::shiftLeftTo):
69         (WebCore::Display::Box::Rect::shiftRightTo):
70         (WebCore::Display::Box::Rect::shiftTopTo):
71         (WebCore::Display::Box::Rect::shiftBottomTo):
72         (WebCore::Display::Box::Rect::expand):
73         (WebCore::Display::Box::invalidateTop): Deleted.
74         (WebCore::Display::Box::invalidateLeft): Deleted.
75         (WebCore::Display::Box::invalidateWidth): Deleted.
76         (WebCore::Display::Box::invalidateHeight): Deleted.
77         (WebCore::Display::Box::hasValidPosition const): Deleted.
78         (WebCore::Display::Box::hasValidSize const): Deleted.
79         (WebCore::Display::Box::hasValidGeometry const): Deleted.
80         (WebCore::Display::Box::invalidatePosition): Deleted.
81         (WebCore::Display::Box::setHasValidPosition): Deleted.
82
83 2018-05-28  Zalan Bujtas  <zalan@apple.com>
84
85         [LFC] Add formatting context testing codepath in FrameViewLayoutContext
86         https://bugs.webkit.org/show_bug.cgi?id=186036
87
88         Reviewed by Antti Koivisto.
89
90         This is to verify the formatting context layout correctness.
91
92         * layout/LayoutContext.cpp:
93         (WebCore::Layout::LayoutContext::LayoutContext):
94         (WebCore::Layout::LayoutContext::initializeRoot):
95         * layout/LayoutContext.h:
96         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
97         * page/FrameViewLayoutContext.cpp:
98         (WebCore::layoutUsingFormattingContext):
99         (WebCore::FrameViewLayoutContext::layout):
100
101 2018-05-28  Zalan Bujtas  <zalan@apple.com>
102
103         [LFC] Add layout tree verification.
104         https://bugs.webkit.org/show_bug.cgi?id=186018
105
106         Reviewed by Antti Koivisto.
107
108         Compare layout and render tree geometry and output the mismtaching rectangles.
109
110         * Sources.txt:
111         * WebCore.xcodeproj/project.pbxproj: Add missing headers and make then private.
112         * layout/LayoutContext.h:
113         * layout/Verification.cpp: Added.
114         (WebCore::Layout::outputMismatchedBoxInformationIfNeeded):
115         (WebCore::Layout::verifySubtree):
116         (WebCore::Layout::LayoutContext::verifyAndOutputLayoutTree const):
117
118 2018-05-28  Sam Weinig  <sam@webkit.org>
119
120         Modernize SVGRenderStyleDefs.h
121         https://bugs.webkit.org/show_bug.cgi?id=186024
122
123         Reviewed by Daniel Bates.
124
125         Modernized the set of enums in SVGRenderStyleDefs.h and WindRule.h by:
126             - Converting them to enum classes
127             - Renaming them to remove unnecessary prefix 'E's
128             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
129             - Renaming to match modern conventions (e.g BNONE -> None)
130
131         Modernizes the following enums:
132             SVGPaintType
133             BaselineShift (renamed from EBaselineShift)
134             TextAnchor (renamed from ETextAnchor)
135             ColorInterpolation (renamed from EColorInterpolation)
136             ColorRendering (renamed from EColorRendering)
137             ShapeRendering (renamed from EShapeRendering)
138             GlyphOrientation (renamed from EGlyphOrientation)
139             AlignmentBaseline (renamed from EAlignmentBaseline)
140             DominantBaseline (renamed from EDominantBaseline)
141             VectorEffect (renamed from EVectorEffect)
142             BufferedRendering (renamed from EBufferedRendering)
143             MaskType (renamed from EMaskType)
144             WindRule
145
146         * css/CSSBasicShapes.cpp:
147         (WebCore::buildPathString):
148         (WebCore::buildPolygonString):
149         * css/CSSBasicShapes.h:
150         * css/CSSPrimitiveValueMappings.h:
151         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
152         (WebCore::CSSPrimitiveValue::operator WindRule const):
153         (WebCore::CSSPrimitiveValue::operator AlignmentBaseline const):
154         (WebCore::CSSPrimitiveValue::operator BufferedRendering const):
155         (WebCore::CSSPrimitiveValue::operator ColorInterpolation const):
156         (WebCore::CSSPrimitiveValue::operator ColorRendering const):
157         (WebCore::CSSPrimitiveValue::operator DominantBaseline const):
158         (WebCore::CSSPrimitiveValue::operator ShapeRendering const):
159         (WebCore::CSSPrimitiveValue::operator TextAnchor const):
160         (WebCore::CSSPrimitiveValue::operator VectorEffect const):
161         (WebCore::CSSPrimitiveValue::operator MaskType const):
162         (WebCore::CSSPrimitiveValue::operator EAlignmentBaseline const): Deleted.
163         (WebCore::CSSPrimitiveValue::operator EBufferedRendering const): Deleted.
164         (WebCore::CSSPrimitiveValue::operator EColorInterpolation const): Deleted.
165         (WebCore::CSSPrimitiveValue::operator EColorRendering const): Deleted.
166         (WebCore::CSSPrimitiveValue::operator EDominantBaseline const): Deleted.
167         (WebCore::CSSPrimitiveValue::operator EShapeRendering const): Deleted.
168         (WebCore::CSSPrimitiveValue::operator ETextAnchor const): Deleted.
169         (WebCore::CSSPrimitiveValue::operator EVectorEffect const): Deleted.
170         (WebCore::CSSPrimitiveValue::operator EMaskType const): Deleted.
171         * css/SVGCSSComputedStyleDeclaration.cpp:
172         (WebCore::glyphOrientationToCSSPrimitiveValue):
173         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
174         (WebCore::ComputedStyleExtractor::svgPropertyValue):
175         * css/StyleBuilderConverter.h:
176         (WebCore::StyleBuilderConverter::convertGlyphOrientation):
177         (WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
178         * css/StyleBuilderCustom.h:
179         (WebCore::StyleBuilderCustom::applyValueBaselineShift):
180         (WebCore::StyleBuilderCustom::applyValueFill):
181         (WebCore::StyleBuilderCustom::applyValueStroke):
182         * css/parser/CSSPropertyParser.cpp:
183         (WebCore::consumeBasicShapePolygon):
184         (WebCore::consumeBasicShapePath):
185         * html/canvas/CanvasRenderingContext2DBase.cpp:
186         (WebCore::toWindRule):
187         * page/animation/CSSPropertyAnimation.cpp:
188         (WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
189         * platform/graphics/FloatPolygon.cpp:
190         (WebCore::FloatPolygon::contains const):
191         * platform/graphics/GraphicsContext.cpp:
192         (WebCore::GraphicsContext::fillRectWithRoundedHole):
193         * platform/graphics/GraphicsContext.h:
194         * platform/graphics/GraphicsLayer.cpp:
195         (WebCore::GraphicsLayer::shapeLayerWindRule const):
196         * platform/graphics/GraphicsLayer.h:
197         * platform/graphics/GraphicsTypes.cpp:
198         (WebCore::operator<<):
199         * platform/graphics/Path.h:
200         * platform/graphics/ShadowBlur.cpp:
201         (WebCore::ShadowBlur::drawInsetShadow):
202         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
203         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
204         * platform/graphics/WindRule.h:
205         (): Deleted.
206         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
207         (PlatformCALayerCocoa::shapeWindRule const):
208         (PlatformCALayerCocoa::setShapeWindRule):
209         * platform/graphics/cg/GraphicsContextCG.cpp:
210         (WebCore::calculateDrawingMode):
211         (WebCore::GraphicsContext::fillPath):
212         (WebCore::GraphicsContext::fillRectWithRoundedHole):
213         (WebCore::GraphicsContext::clipPath):
214         * platform/graphics/cg/PathCG.cpp:
215         (WebCore::Path::contains const):
216         * platform/mock/MockRealtimeVideoSource.cpp:
217         (WebCore::MockRealtimeVideoSource::drawAnimation):
218         * rendering/FilterEffectRenderer.cpp:
219         (WebCore::FilterEffectRenderer::buildReferenceFilter):
220         * rendering/RenderBoxModelObject.cpp:
221         (WebCore::RenderBoxModelObject::paintBorder):
222         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
223         * rendering/RenderElement.cpp:
224         (WebCore::RenderElement::paintOutline):
225         * rendering/RenderLayer.cpp:
226         (WebCore::RenderLayer::computeClipPath const):
227         * rendering/style/BasicShapes.h:
228         (WebCore::BasicShape::windRule const):
229         * rendering/style/RenderStyle.h:
230         (WebCore::RenderStyle::fillPaintType const):
231         (WebCore::RenderStyle::setFillPaintColor):
232         (WebCore::RenderStyle::strokePaintType const):
233         (WebCore::RenderStyle::setStrokePaintColor):
234         * rendering/style/SVGRenderStyle.h:
235         (WebCore::SVGRenderStyle::initialAlignmentBaseline):
236         (WebCore::SVGRenderStyle::initialDominantBaseline):
237         (WebCore::SVGRenderStyle::initialBaselineShift):
238         (WebCore::SVGRenderStyle::initialVectorEffect):
239         (WebCore::SVGRenderStyle::initialBufferedRendering):
240         (WebCore::SVGRenderStyle::initialClipRule):
241         (WebCore::SVGRenderStyle::initialColorInterpolation):
242         (WebCore::SVGRenderStyle::initialColorInterpolationFilters):
243         (WebCore::SVGRenderStyle::initialColorRendering):
244         (WebCore::SVGRenderStyle::initialFillRule):
245         (WebCore::SVGRenderStyle::initialShapeRendering):
246         (WebCore::SVGRenderStyle::initialTextAnchor):
247         (WebCore::SVGRenderStyle::initialGlyphOrientationHorizontal):
248         (WebCore::SVGRenderStyle::initialGlyphOrientationVertical):
249         (WebCore::SVGRenderStyle::initialFillPaintType):
250         (WebCore::SVGRenderStyle::initialStrokePaintType):
251         (WebCore::SVGRenderStyle::initialMaskType):
252         (WebCore::SVGRenderStyle::setAlignmentBaseline):
253         (WebCore::SVGRenderStyle::setDominantBaseline):
254         (WebCore::SVGRenderStyle::setBaselineShift):
255         (WebCore::SVGRenderStyle::setVectorEffect):
256         (WebCore::SVGRenderStyle::setBufferedRendering):
257         (WebCore::SVGRenderStyle::setClipRule):
258         (WebCore::SVGRenderStyle::setColorInterpolation):
259         (WebCore::SVGRenderStyle::setColorInterpolationFilters):
260         (WebCore::SVGRenderStyle::setColorRendering):
261         (WebCore::SVGRenderStyle::setFillRule):
262         (WebCore::SVGRenderStyle::setShapeRendering):
263         (WebCore::SVGRenderStyle::setTextAnchor):
264         (WebCore::SVGRenderStyle::setGlyphOrientationHorizontal):
265         (WebCore::SVGRenderStyle::setGlyphOrientationVertical):
266         (WebCore::SVGRenderStyle::setMaskType):
267         (WebCore::SVGRenderStyle::alignmentBaseline const):
268         (WebCore::SVGRenderStyle::dominantBaseline const):
269         (WebCore::SVGRenderStyle::baselineShift const):
270         (WebCore::SVGRenderStyle::vectorEffect const):
271         (WebCore::SVGRenderStyle::bufferedRendering const):
272         (WebCore::SVGRenderStyle::clipRule const):
273         (WebCore::SVGRenderStyle::colorInterpolation const):
274         (WebCore::SVGRenderStyle::colorInterpolationFilters const):
275         (WebCore::SVGRenderStyle::colorRendering const):
276         (WebCore::SVGRenderStyle::fillRule const):
277         (WebCore::SVGRenderStyle::shapeRendering const):
278         (WebCore::SVGRenderStyle::textAnchor const):
279         (WebCore::SVGRenderStyle::glyphOrientationHorizontal const):
280         (WebCore::SVGRenderStyle::glyphOrientationVertical const):
281         (WebCore::SVGRenderStyle::fillPaintType const):
282         (WebCore::SVGRenderStyle::strokePaintType const):
283         (WebCore::SVGRenderStyle::maskType const):
284         (WebCore::SVGRenderStyle::visitedLinkFillPaintType const):
285         (WebCore::SVGRenderStyle::visitedLinkStrokePaintType const):
286         (WebCore::SVGRenderStyle::hasStroke const):
287         (WebCore::SVGRenderStyle::hasFill const):
288         (WebCore::SVGRenderStyle::setBitDefaults):
289         * rendering/style/SVGRenderStyleDefs.h:
290         (WebCore::StyleFillData::create):
291         (WebCore::StyleFillData::operator!= const):
292         (WebCore::StyleStrokeData::create):
293         (WebCore::StyleStrokeData::operator!= const):
294         (WebCore::StyleStopData::create):
295         (WebCore::StyleStopData::operator!= const):
296         (WebCore::StyleTextData::create):
297         (WebCore::StyleTextData::operator!= const):
298         (WebCore::StyleMiscData::create):
299         (WebCore::StyleMiscData::operator!= const):
300         (WebCore::StyleShadowSVGData::create):
301         (WebCore::StyleShadowSVGData::operator!= const):
302         (WebCore::StyleResourceData::create):
303         (WebCore::StyleResourceData::operator!= const):
304         (WebCore::StyleInheritedResourceData::create):
305         (WebCore::StyleInheritedResourceData::operator!= const):
306         (WebCore::StyleLayoutData::create):
307         (WebCore::StyleLayoutData::operator!= const):
308         (): Deleted.
309         * rendering/svg/RenderSVGImage.cpp:
310         (WebCore::RenderSVGImage::paint):
311         * rendering/svg/RenderSVGRect.cpp:
312         (WebCore::RenderSVGRect::updateShapeFromElement):
313         * rendering/svg/RenderSVGResource.cpp:
314         (WebCore::requestPaintingResource):
315         * rendering/svg/RenderSVGResourceClipper.cpp:
316         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
317         * rendering/svg/RenderSVGResourceFilter.cpp:
318         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
319         * rendering/svg/RenderSVGResourceGradient.cpp:
320         (WebCore::RenderSVGResourceGradient::applyResource):
321         * rendering/svg/RenderSVGResourceMasker.cpp:
322         (WebCore::RenderSVGResourceMasker::applyResource):
323         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
324         * rendering/svg/RenderSVGResourcePattern.cpp:
325         (WebCore::RenderSVGResourcePattern::applyResource):
326         * rendering/svg/RenderSVGShape.cpp:
327         (WebCore::RenderSVGShape::paint):
328         * rendering/svg/RenderSVGShape.h:
329         (WebCore::RenderSVGShape::hasNonScalingStroke const):
330         * rendering/svg/SVGRenderTreeAsText.cpp:
331         (WebCore::writeStyle):
332         (WebCore::writeSVGInlineTextBox):
333         * rendering/svg/SVGResources.cpp:
334         (WebCore::paintingResourceFromSVGPaint):
335         * rendering/svg/SVGTextChunk.cpp:
336         (WebCore::SVGTextChunk::SVGTextChunk):
337         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
338         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
339         (WebCore::SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline const):
340         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
341         (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
342         * rendering/svg/SVGTextLayoutEngineBaseline.h:
343
344 2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
345
346         [Web Animations] Test webanimations/css-animations.html is crashing
347         https://bugs.webkit.org/show_bug.cgi?id=186031
348
349         Reviewed by Antoine Quint.
350
351         This is another case of std::optional value being used while it's nullopt, I guess this started to fail when we
352         stopped using the WTF implementation of std::optional. The problem is that we try to get the current iteration
353         of a declarative animation when the active time is unresolved.
354
355         * animation/DeclarativeAnimation.cpp:
356         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Use value_or(0) instead of value() to get the current
357         iteration of the effect.
358
359 2018-05-28  Thibault Saunier  <tsaunier@igalia.com>
360
361         [GStreamer] Handle changes in the "drm-preferred-decryption-system-id" NEED_CONTEXT message.
362         https://bugs.webkit.org/show_bug.cgi?id=185948
363
364         Reviewed by Xabier Rodriguez-Calvar.
365
366         - The "stream-encryption-systems" field of the "drm-preferred-decryption-system-id" query was renamed to
367           "avalaible-stream-encryption-systems"
368         - It can now be NULL, meaning there is no decryptor avalaible.
369
370         Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
371
372         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
373         (WebCore::extractEventsAndSystemsFromMessage): Handle NULL value for "avalaible-stream-encryption-systems",
374         moved some code to make the order of the Arrays in the pair clearer.
375
376 2018-05-27  Dan Bernstein  <mitz@apple.com>
377
378         Reverted the changes made for https://webkit.org/b/186016
379
380         They broke the USE(APPLE_INTERNAL_SDK) Sierra build.
381
382 2018-05-27  David Kilzer  <ddkilzer@apple.com>
383
384         [iOS] Fix warnings about leaks found by clang static analyzer
385         <https://webkit.org/b/186009>
386         <rdar://problem/40574267>
387
388         Reviewed by Daniel Bates.
389
390         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
391         (WebCore::LocalAuthenticator::makeCredential):
392         (WebCore::LocalAuthenticator::getAssertion):
393         (WebCore::LocalAuthenticator::issueClientCertificate const):
394         - Don't leak CF objects in early return paths, and get rid of
395           `retained*` variables, by making original variables use
396           RetainPtr<>.
397         * bridge/objc/WebScriptObject.mm:
398         (+[WebUndefined allocWithZone:]): Modernize WebUndefined by
399         using NeverDestroyed<RetainPr<WebUndefined>> type.  Explicitly
400         retain the object returned on each call.
401         (+[WebUndefined undefined]): Explicitly autorelease the object
402         returned.  Note that neither of these changes fixes the static
403         analyzer warnings in this source file.
404         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
405         (WebCore::exernalDeviceDisplayNameForPlayer): Use RetainPtr<> to
406         stop leaking NSString objects in a loop.
407         * platform/ios/wak/WAKWindow.h:
408         (-[WAKWindow _newFirstResponderAfterResigning]): Mark as
409         NS_RETURNS_NOT_RETAINED like the corresponding AppKit method
410         since this doesn't return a new object.  This fixes some
411         false-positive leaks warnings.
412
413 2018-05-27  Dan Bernstein  <mitz@apple.com>
414
415         [Cocoa] Avoid importing directly from subumbrella frameworks
416         https://bugs.webkit.org/show_bug.cgi?id=186016
417
418         Reviewed by Sam Weinig.
419
420         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
421           OTHER_CPLUSPLUSFLAGS.
422         * editing/mac/DictionaryLookup.mm: Import Quartz.h instead of a PDFKit header.
423         * html/HTMLKeygenElement.cpp: Removed "using namespace WebCore" from this WebCore
424           implementation file.
425         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
426         * platform/mac/PlatformScreenMac.mm: Import ApplicationServices.h instead of ColorSync.h
427           when using SDKs earlier than 10.13.
428         * platform/mediastream/CaptureDeviceManager.cpp: Enclosed the definitions in the WebCore
429           namespace and removed "using namespace WebCore" from this WebCore implementation file.
430         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
431
432 2018-05-27  Fujii Hironori  <Hironori.Fujii@sony.com>
433
434         REGRESSION(r232198) [WinCairo] cannot convert from 'WTF::StringView' to 'const WTF::String'
435         https://bugs.webkit.org/show_bug.cgi?id=186027
436
437         Unreviewed build fix
438
439         No new tests (No behavior change).
440
441         * platform/network/curl/AuthenticationChallengeCurl.cpp:
442         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
443         * platform/network/curl/CurlRequest.cpp:
444         (WebCore::CurlRequest::setupTransfer):
445         (WebCore::CurlRequest::willSetupSslCtx):
446
447 2018-05-27  Sam Weinig  <sam@webkit.org>
448
449         Modernize RenderStyleConstants.h - Part 3
450         https://bugs.webkit.org/show_bug.cgi?id=186015
451
452         Reviewed by Yusuke Suzuki.
453
454         Modernized the third and final set of enums in RenderStyleConstants.h by:
455             - Converting them to enum classes
456             - Renaming them to remove unnecessary prefix 'E's
457             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
458
459         Modernizes the following enums:
460             TextDecoration
461             TextDecorationSkip (renamed from TextDecorationSkipItems)
462             TextUnderlinePosition
463             HangingPunctuation
464             SpeakAs (renamed from ESpeakAs)
465             TextEmphasisPosition (renamed from TextEmphasisPositions)
466
467         This final set of enums are mostly (TextUnderlinePosition isn't really) used as bitmasks,
468         so this change also converts their uses to use OptionSet. 
469
470         * accessibility/AccessibilityObject.h:
471         (WebCore::AccessibilityObject::speakAsProperty const):
472         * accessibility/AccessibilityRenderObject.cpp:
473         (WebCore::AccessibilityRenderObject::speakAsProperty const):
474         (WebCore::AccessibilityRenderObject::hasPlainText const):
475         (WebCore::AccessibilityRenderObject::hasUnderline const):
476         * accessibility/AccessibilityRenderObject.h:
477         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
478         (AXAttributeStringSetStyle):
479         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
480         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
481         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
482         (AXAttributeStringSetStyle):
483         * css/CSSComputedStyleDeclaration.cpp:
484         (WebCore::renderTextDecorationFlagsToCSSValue):
485         (WebCore::renderTextDecorationSkipFlagsToCSSValue):
486         (WebCore::renderEmphasisPositionFlagsToCSSValue):
487         (WebCore::speakAsToCSSValue):
488         (WebCore::hangingPunctuationToCSSValue):
489         * css/CSSLineBoxContainValue.h:
490         * css/CSSPrimitiveValueMappings.h:
491         (WebCore::CSSPrimitiveValue::operator HangingPunctuation const):
492         (WebCore::CSSPrimitiveValue::operator TextDecoration const):
493         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
494         (WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
495         (WebCore::CSSPrimitiveValue::operator SpeakAs const):
496         (WebCore::CSSPrimitiveValue::operator ESpeakAs const): Deleted.
497         * css/StyleBuilderConverter.h:
498         (WebCore::StyleBuilderConverter::convertTextDecoration):
499         (WebCore::StyleBuilderConverter::valueToEmphasisPosition):
500         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
501         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
502         (WebCore::StyleBuilderConverter::valueToDecorationSkip):
503         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
504         (WebCore::StyleBuilderConverter::convertSpeakAs):
505         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
506         * editing/cocoa/EditorCocoa.mm:
507         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const):
508         * editing/cocoa/HTMLConverter.mm:
509         (WebCore::editingAttributedStringFromRange):
510         * rendering/InlineFlowBox.cpp:
511         (WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine const):
512         (WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine const):
513         * rendering/InlineFlowBox.h:
514         * rendering/InlineTextBox.cpp:
515         (WebCore::emphasisPositionHasNeitherLeftNorRight):
516         (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
517         (WebCore::InlineTextBox::paint):
518         (WebCore::InlineTextBox::paintMarkedTextDecoration):
519         * rendering/RenderBlockFlow.cpp:
520         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
521         * rendering/RenderBlockLineLayout.cpp:
522         (WebCore::setLogicalWidthForTextRun):
523         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
524         * rendering/RenderElement.cpp:
525         (WebCore::RenderElement::enclosingRendererWithTextDecoration const):
526         * rendering/RenderElement.h:
527         * rendering/RenderTableSection.cpp:
528         (WebCore::RenderTableSection::addCell):
529         * rendering/SimpleLineLayout.cpp:
530         (WebCore::SimpleLineLayout::canUseForStyle):
531         (WebCore::SimpleLineLayout::canUseForWithReason):
532         * rendering/SimpleLineLayoutFunctions.cpp:
533         (WebCore::SimpleLineLayout::paintFlow):
534         * rendering/TextDecorationPainter.cpp:
535         (WebCore::TextDecorationPainter::TextDecorationPainter):
536         (WebCore::TextDecorationPainter::paintTextDecoration):
537         (WebCore::collectStylesForRenderer):
538         (WebCore::TextDecorationPainter::stylesForRenderer):
539         * rendering/TextDecorationPainter.h:
540         * rendering/TextPaintStyle.cpp:
541         (WebCore::computeTextPaintStyle):
542         * rendering/line/BreakingContext.h:
543         (WebCore::BreakingContext::handleText):
544         * rendering/style/RenderStyle.cpp:
545         (WebCore::RenderStyle::RenderStyle):
546         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
547         * rendering/style/RenderStyle.h:
548         (WebCore::RenderStyle::textDecorationsInEffect const):
549         (WebCore::RenderStyle::textDecoration const):
550         (WebCore::RenderStyle::textDecorationSkip const):
551         (WebCore::RenderStyle::hangingPunctuation const):
552         (WebCore::RenderStyle::textEmphasisPosition const):
553         (WebCore::RenderStyle::speakAs const):
554         (WebCore::RenderStyle::addToTextDecorationsInEffect):
555         (WebCore::RenderStyle::setTextDecorationsInEffect):
556         (WebCore::RenderStyle::setTextDecoration):
557         (WebCore::RenderStyle::setTextDecorationSkip):
558         (WebCore::RenderStyle::setSpeakAs):
559         (WebCore::RenderStyle::setTextEmphasisPosition):
560         (WebCore::RenderStyle::setHangingPunctuation):
561         (WebCore::RenderStyle::initialHangingPunctuation):
562         (WebCore::RenderStyle::initialTextDecoration):
563         (WebCore::RenderStyle::initialTextDecorationSkip):
564         (WebCore::RenderStyle::initialTextUnderlinePosition):
565         (WebCore::RenderStyle::initialSpeakAs):
566         (WebCore::RenderStyle::initialTextEmphasisPosition):
567         * rendering/style/RenderStyleConstants.h:
568         (WebCore::operator|): Deleted.
569         (WebCore::operator|=): Deleted.
570         * rendering/style/StyleRareInheritedData.cpp:
571         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
572         * rendering/style/StyleVisualData.cpp:
573         (WebCore::StyleVisualData::StyleVisualData):
574         * rendering/svg/SVGInlineTextBox.cpp:
575         (WebCore::SVGInlineTextBox::paint):
576         (WebCore::positionOffsetForDecoration):
577         (WebCore::thicknessForDecoration):
578         (WebCore::findRendererDefininingTextDecoration):
579         (WebCore::SVGInlineTextBox::paintDecoration):
580         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
581         * rendering/svg/SVGInlineTextBox.h:
582         * style/InlineTextBoxStyle.cpp:
583         (WebCore::computeUnderlineOffset):
584         (WebCore::visualOverflowForDecorations):
585
586 2018-05-26  Zalan Bujtas  <zalan@apple.com>
587
588         [LFC] Implement margin computation
589         https://bugs.webkit.org/show_bug.cgi?id=186008
590
591         Reviewed by Antti Koivisto.
592
593         * WebCore.xcodeproj/project.pbxproj:
594         * layout/FormattingContext.cpp:
595         (WebCore::Layout::FormattingContext::computeMargin const):
596         (WebCore::Layout::FormattingContext::marginTop const): Deleted.
597         (WebCore::Layout::FormattingContext::marginLeft const): Deleted.
598         (WebCore::Layout::FormattingContext::marginBottom const): Deleted.
599         (WebCore::Layout::FormattingContext::marginRight const): Deleted.
600         * layout/FormattingContext.h:
601         * layout/blockformatting/BlockFormattingContext.cpp:
602         (WebCore::Layout::BlockFormattingContext::layout const):
603         (WebCore::Layout::BlockFormattingContext::computeMargin const):
604         (WebCore::Layout::BlockFormattingContext::marginTop const): Deleted.
605         (WebCore::Layout::BlockFormattingContext::marginBottom const): Deleted.
606         * layout/blockformatting/BlockFormattingContext.h:
607         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
608         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight):
609         (WebCore::Layout::BlockFormattingContext::Geometry::computedMargin):
610         * layout/blockformatting/BlockMarginCollapse.cpp:
611         (WebCore::Layout::_isMarginBottomCollapsedWithParent):
612         (WebCore::Layout::collapsedMarginBottomFromLastChild):
613         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
614         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
615         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
616         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
617         (WebCore::Layout::BlockMarginCollapse::marginTop): Deleted.
618         (WebCore::Layout::BlockMarginCollapse::marginBottom): Deleted.
619         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
620         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
621         * layout/blockformatting/BlockMarginCollapse.h: Removed.
622
623 2018-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
624
625         [Cocoa] Delete unnecessary WebCascadeList in ComplexTextController
626         https://bugs.webkit.org/show_bug.cgi?id=186007
627
628         Reviewed by Zalan Bujtas.
629
630         Inside ComplexTextController::collectComplexTextRuns(), we chop up text based on which fonts should be
631         used to render which grapheme clusters. For each grapheme cluster, we run through the font-family list
632         in FontCascade::fontForCombiningCharacterSequence() and find the first font that can render the cluster.
633         If no items can render the cluster, we construct a WebCascadeList and let CoreText try to figure out
634         which fonts can render which clusters.
635
636         Except there's no point, because we just determined that no font in the list can be used to render the
637         cluster. CoreText isn't magic; it isn't going to somehow disagree with us. WebCascadeList is just
638         useless code.
639
640         No new tests because there is no behavior change.
641
642         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
643         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
644         (-[WebCascadeList initWithFont:character:]): Deleted.
645         (-[WebCascadeList count]): Deleted.
646         (-[WebCascadeList objectAtIndex:]): Deleted.
647
648 2018-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
649
650         Improve the performance of Font::canRenderCombiningCharacterSequence()
651         https://bugs.webkit.org/show_bug.cgi?id=185933
652
653         Reviewed by Ryosuke Niwa.
654
655         We don't need to create a whole CTLine just to determine whether or not a font supports rendering a grapheme cluster.
656         Instead, the right way to do it is just see if the font's cmap table supports every code point in the cluster.
657
658         This patch reports a 2% progression on the attached PerformanceTest.
659
660         Test: Layout/ComplexLongUnique.html
661
662         * platform/graphics/Font.cpp:
663         (WebCore::Font::canRenderCombiningCharacterSequence const):
664         * platform/graphics/Font.h:
665         * platform/graphics/cocoa/FontCocoa.mm:
666         (WebCore::provideStringAndAttributes): Deleted.
667         (WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
668         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
669         (WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
670
671 2018-05-25  Eric Carlson  <eric.carlson@apple.com>
672
673         Captions are sized incorrectly in PiP mode
674         https://bugs.webkit.org/show_bug.cgi?id=186005
675         <rdar://problem/39729718>
676
677         Reviewed by Dean Jackson.
678
679         * html/shadow/MediaControlElements.cpp:
680         (WebCore::MediaControlTextTrackContainerElement::updateSizes): Only sync text track bounds 
681         when the size actually changes.
682
683         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
684         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame): Call syncTextTrackBounds.
685         (WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds): Set the text track layer size
686         to m_videoFullscreenFrame, it is always set the size of the PiP/Fullscreen layer.
687
688 2018-05-25  Timothy Hatcher  <timothy@apple.com>
689
690         Setting drawsBackground to YES on a WKView doesn't take effect immediately
691         https://bugs.webkit.org/show_bug.cgi?id=185885
692         rdar://problem/39706506
693
694         Reviewed by Simon Fraser.
695
696         * page/Frame.cpp:
697         (WebCore::Frame::createView): Always call updateBackgroundRecursively, it handles
698         invalid colors correctly already.
699         * page/FrameView.cpp:
700         (WebCore::FrameView::setTransparent): Call setNeedsLayout() since base background color
701         and transparent is used to update layers.
702         (WebCore::FrameView::setBaseBackgroundColor): Ditto.
703         (WebCore::FrameView::updateBackgroundRecursively): Schedule layout if needed.
704         * page/FrameView.h:
705         * rendering/RenderLayerCompositor.cpp:
706         (WebCore::RenderLayerCompositor::viewHasTransparentBackground const): Use baseBackgroundColor
707         instead of hardcoding white.
708         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): Fixed incorrect changed logging.
709
710 2018-05-25  Youenn Fablet  <youenn@apple.com>
711
712         Migrate From-Origin to Cross-Origin-Resource-Policy
713         https://bugs.webkit.org/show_bug.cgi?id=185840
714
715         Reviewed by Chris Dumez.
716
717         Tests: http/wpt/cross-origin-resource-policy/fetch-in-iframe.html
718                http/wpt/cross-origin-resource-policy/fetch.html
719                http/wpt/cross-origin-resource-policy/iframe-loads.html
720                http/wpt/cross-origin-resource-policy/image-loads.html
721                http/wpt/cross-origin-resource-policy/script-loads.html
722
723         * platform/network/HTTPHeaderNames.in:
724         * platform/network/HTTPParsers.cpp:
725         (WebCore::parseCrossOriginResourcePolicyHeader):
726         * platform/network/HTTPParsers.h:
727
728 2018-05-25  Daniel Bates  <dabates@apple.com>
729
730         NavigationAction should not hold a strong reference to a Document
731         https://bugs.webkit.org/show_bug.cgi?id=185712
732         <rdar://problem/40320916>
733
734         Reviewed by Brent Fulgham.
735
736         Have NavigationAction store all the relevant details callers need to know about the document
737         that initiated the navigation in an independent data structure, called NavigationAction::Requester,
738         as opposed to holding a RefPtr to the document itself. The benefit of this approach is that it
739         is a step towards ensuring that NavigationAction does not keep the document alive after navigating
740         to a new document given that DocumentLoader stores the NavigationAction for the last navigation.
741
742         * loader/NavigationAction.cpp:
743         (WebCore::NavigationAction::Requester::Requester): Track all relevant details of the document that
744         requested this navigation that are needed to support WebKit API/SPI. We hold the SecurityOrigin in
745         a RefPtr to avoid the need to explicitly define a copy constructor and copy-assignment constructor
746         because Requester needs to be copyable as NavigationAction, which owns a Requester, is copyable.
747         (WebCore::shouldTreatAsSameOriginNavigation): Fix some style nits.
748         (WebCore::NavigationAction::NavigationAction): Instantiate a Requester from the specified document.
749         * loader/NavigationAction.h:
750         (WebCore::NavigationAction::Requester::url const): Added.
751         (WebCore::NavigationAction::Requester::securityOrigin const): Added.
752         (WebCore::NavigationAction::Requester::pageID const): Added.
753         (WebCore::NavigationAction::Requester::frameID const): Added.
754         (WebCore::NavigationAction::requester const): Returns details about the document that requested
755         this navigation, if applicable.
756         (WebCore::NavigationAction::isEmpty const): Update criterion for being empty to consider the
757         requester.
758         (WebCore::NavigationAction::setOpener): Extracted out the datatype of the parameter into a
759         type alias to avoid duplication and updated this code to use the alias.
760         (WebCore::NavigationAction::opener const): Ditto.
761         (WebCore::NavigationAction::sourceDocument const): Deleted.
762
763 2018-05-25  Jeremy Jones  <jeremyj@apple.com>
764
765         Fullscreen element can be clipped by ancestor.
766         https://bugs.webkit.org/show_bug.cgi?id=185980
767         rdar://problem/40320006
768
769         Reviewed by Jer Noble.
770
771         Adds style to fullscreen css to prevent the fullscreen element from being clipped by an ancestor element.
772
773         * css/fullscreen.css:
774         (:-webkit-full-screen-ancestor:not(iframe)):
775
776 2018-05-25  Jeremy Jones  <jeremyj@apple.com>
777
778         Use correct AVKit delegate for picture in picture failure.
779         https://bugs.webkit.org/show_bug.cgi?id=185981
780         rdar://problem/40549652
781
782         Reviewed by Eric Carlson.
783
784         No new tests since we don't have a way to simulate picture-in-picture failure.
785
786         Use the new name for this delegate callback.
787
788         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
789         (-[WebAVPlayerViewControllerDelegate playerViewController:failedToStartPictureInPictureWithError:]):
790         (-[WebAVPlayerViewControllerDelegate playerViewControllerFailedToStartPictureInPicture:withError:]): Deleted.
791
792 2018-05-25  Zalan Bujtas  <zalan@apple.com>
793
794         iBooks: text can disappear/flash during finger drag highlight
795         https://bugs.webkit.org/show_bug.cgi?id=185993
796         <rdar://problem/34026943>
797
798         Reviewed by Simon Fraser.
799
800         Reuse existing tiles when override rect is fully covered by the active grid.
801         Also, recover dropped tiles if override rect forces us to create new ones. 
802
803         Unable to create a reproducible test case.
804
805         * platform/ios/LegacyTileCache.h:
806         * platform/ios/LegacyTileCache.mm:
807         (WebCore::LegacyTileCache::setOverrideVisibleRect):
808         * platform/ios/LegacyTileLayer.mm:
809         (-[LegacyTileHostLayer renderInContext:]):
810
811 2018-05-25  Eric Carlson  <eric.carlson@apple.com>
812
813         Encode ISOWebVTTCue "strings" when logging
814         https://bugs.webkit.org/show_bug.cgi?id=185991
815         <rdar://problem/40563902>
816
817         Reviewed by Jer Noble.
818
819         * platform/graphics/iso/ISOVTTCue.cpp:
820         (WebCore::ISOWebVTTCue::toJSONString const): Use encodeWithURLEscapeSequences for all Strings
821         taken from ISO boxes.
822
823 2018-05-25  Alex Christensen  <achristensen@webkit.org>
824
825         URL::host should return a StringView to reduce allocations
826         https://bugs.webkit.org/show_bug.cgi?id=185986
827
828         Reviewed by Geoff Garen.
829
830         No change in behaviour.  Just fewer allocations.
831
832         * Modules/plugins/YouTubePluginReplacement.cpp:
833         (WebCore::isYouTubeURL):
834         (WebCore::processAndCreateYouTubeURL):
835         * Modules/websockets/WebSocketHandshake.cpp:
836         (WebCore::hostName):
837         (WebCore::WebSocketHandshake::host const):
838         * contentextensions/ContentExtension.cpp:
839         (WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
840         * html/HTMLAnchorElement.cpp:
841         (WebCore::HTMLAnchorElement::parseAttribute):
842         * html/HTMLMediaElement.cpp:
843         (WebCore::HTMLMediaElement::mediaSessionTitle const):
844         (WebCore::needsSeekingSupportQuirk):
845         * html/HTMLPlugInImageElement.cpp:
846         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
847         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
848         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
849         * html/ImageDocument.cpp:
850         (WebCore::ImageDocument::finishedParsing):
851         * html/URLUtils.h:
852         (WebCore::URLUtils<T>::hostname const):
853         * loader/FrameLoader.cpp:
854         (WebCore::FrameLoader::setFirstPartyForCookies):
855         * loader/LinkLoader.cpp:
856         (WebCore::LinkLoader::loadLink):
857         * loader/ResourceLoadStatistics.cpp:
858         (WebCore::ResourceLoadStatistics::primaryDomain):
859         * loader/mac/LoaderNSURLExtras.mm:
860         (suggestedFilenameWithMIMEType):
861         * page/Chrome.cpp:
862         (WebCore::Chrome::mouseDidMoveOverElement):
863         * page/Location.cpp:
864         (WebCore::Location::hostname const):
865         * page/Page.cpp:
866         (WebCore::Page::mainFrameLoadStarted):
867         * page/PerformanceMonitor.cpp:
868         (WebCore::reportPageOverPostLoadResourceThreshold):
869         * page/SecurityOrigin.cpp:
870         (WebCore::isLoopbackIPAddress):
871         (WebCore::shouldTreatAsPotentiallyTrustworthy):
872         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
873         * page/SecurityOrigin.h:
874         * page/SecurityOriginData.h:
875         (WebCore::SecurityOriginData::fromURL):
876         * page/UserContentURLPattern.cpp:
877         (WebCore::UserContentURLPattern::matchesHost const):
878         * page/csp/ContentSecurityPolicySource.cpp:
879         (WebCore::ContentSecurityPolicySource::hostMatches const):
880         * platform/PublicSuffix.h:
881         * platform/URL.cpp:
882         (WebCore::URL::host const):
883         (WebCore::URL::hostAndPort const):
884         (WebCore::URL::isMatchingDomain const):
885         * platform/URL.h:
886         * platform/mac/SSLKeyGeneratorMac.mm:
887         (WebCore::signedPublicKeyAndChallengeString):
888         * platform/network/ResourceRequestBase.h:
889         (WebCore::registrableDomainsAreEqual):
890         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
891         (WebCore::getPartitioningDomain):
892         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
893         (WebCore::SocketStreamHandleImpl::createStreams):
894         * workers/WorkerLocation.cpp:
895         (WebCore::WorkerLocation::hostname const):
896         * workers/service/server/SWServer.cpp:
897         (WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):
898
899 2018-05-24  Dean Jackson  <dino@apple.com>
900
901         Need to provide a way to feature detect support for system preview
902         https://bugs.webkit.org/show_bug.cgi?id=185970
903         <rdar://problem/40538321>
904
905         Reviewed by Sam Weinig.
906
907         Update the supports function in the DOMTokenList that HTMLAnchorElement
908         produces for relList to return true for the system preview token.
909
910         Tested internally.
911
912         * html/HTMLAnchorElement.cpp:
913         (WebCore::HTMLAnchorElement::relList const):
914
915 2018-05-25  Chris Dumez  <cdumez@apple.com>
916
917         Minor ApplicationCacheStorage clean up
918         https://bugs.webkit.org/show_bug.cgi?id=185984
919
920         Reviewed by Youenn Fablet.
921
922         * loader/appcache/ApplicationCacheStorage.cpp:
923         (WebCore::ApplicationCacheStorage::getManifestURLs):
924         (WebCore::ApplicationCacheStorage::deleteCacheGroup):
925         (WebCore::ApplicationCacheStorage::originsWithCache):
926         (WebCore::ApplicationCacheStorage::deleteAllCaches):
927         (WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
928         (WebCore::ApplicationCacheStorage::ApplicationCacheStorage):
929         (WebCore::ApplicationCacheStorage::cacheDirectory const): Deleted.
930         (WebCore::ApplicationCacheStorage::cacheGroupSize): Deleted.
931         (WebCore::ApplicationCacheStorage::getOriginsWithCache): Deleted.
932         (WebCore::ApplicationCacheStorage::create): Deleted.
933         * loader/appcache/ApplicationCacheStorage.h:
934         (WebCore::ApplicationCacheStorage::create):
935
936 2018-05-25  Sihui Liu  <sihui_liu@apple.com>
937
938         [WKHTTPCookieStore getAllCookies] returns inconsistent creation time
939         https://bugs.webkit.org/show_bug.cgi?id=185041
940         <rdar://problem/34684214>
941
942         Reviewed by Geoffrey Garen.
943
944         Set creationtime property when creating Cookie object to keep consistency after conversion.
945
946         New API test: WebKit.WKHTTPCookieStoreCreationTime.
947
948         * platform/network/cocoa/CookieCocoa.mm:
949         (WebCore::Cookie::operator NSHTTPCookie * const):
950
951 2018-05-25  Zalan Bujtas  <zalan@apple.com>
952
953         [LFC] Implement border and padding computation
954         https://bugs.webkit.org/show_bug.cgi?id=185972
955
956         Reviewed by Antti Koivisto.
957
958         This patch also removes redundant Display::Box methods and adds a lightweight Edge struct.
959         (Since padding is optional, if during layout we mistakenly try to access paddingTop/Left/Bottom/Right, Display::Box will assert!)
960
961         * layout/FormattingContext.cpp:
962         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
963         * layout/FormattingContext.h:
964         * layout/FormattingContextGeometry.cpp:
965         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
966         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
967         * layout/blockformatting/BlockFormattingContext.cpp:
968         (WebCore::Layout::BlockFormattingContext::layout const):
969         * layout/displaytree/DisplayBox.cpp:
970         (WebCore::Display::Box::marginBox const):
971         (WebCore::Display::Box::paddingBox const):
972         (WebCore::Display::Box::contentBox const):
973         * layout/displaytree/DisplayBox.h:
974         (WebCore::Display::Box::Edges::Edges):
975         (WebCore::Display::Box::setHasValidPosition):
976         (WebCore::Display::Box::setWidth):
977         (WebCore::Display::Box::setHeight):
978         (WebCore::Display::Box::setMargin):
979         (WebCore::Display::Box::setBorder):
980         (WebCore::Display::Box::setPadding):
981         (WebCore::Display::Box::marginTop const):
982         (WebCore::Display::Box::marginLeft const):
983         (WebCore::Display::Box::marginBottom const):
984         (WebCore::Display::Box::marginRight const):
985         (WebCore::Display::Box::paddingTop const):
986         (WebCore::Display::Box::paddingLeft const):
987         (WebCore::Display::Box::paddingBottom const):
988         (WebCore::Display::Box::paddingRight const):
989         (WebCore::Display::Box::borderTop const):
990         (WebCore::Display::Box::borderLeft const):
991         (WebCore::Display::Box::borderBottom const):
992         (WebCore::Display::Box::borderRight const):
993         (WebCore::Display::Box::invalidateSize): Deleted.
994         (WebCore::Display::Box::setHasValidSize): Deleted.
995         (WebCore::Display::Box::setHasValidGeometry): Deleted.
996         (WebCore::Display::Box::setRect): Deleted.
997         (WebCore::Display::Box::setSize): Deleted.
998         * layout/layouttree/LayoutBox.cpp:
999         (WebCore::Layout::Box::isPaddingEnabled const):
1000         * layout/layouttree/LayoutBox.h:
1001
1002 2018-05-25  David Kilzer  <ddkilzer@apple.com>
1003
1004         Fix issues with -dealloc methods found by clang static analyzer
1005         <https://webkit.org/b/185887>
1006
1007         Reviewed by Joseph Pecoraro.
1008
1009         * platform/ios/WebAVPlayerController.mm:
1010         (-[WebAVPlayerController dealloc]): Release `_minTiming` and
1011         `_maxTiming` to fix leaks.
1012         * platform/ios/WebBackgroundTaskController.mm:
1013         (-[WebBackgroundTaskController dealloc]): Release
1014         `_backgroundTaskStartBlock` and `_backgroundTaskEndBlock` to fix
1015         leaks.
1016         * platform/ios/WebItemProviderPasteboard.mm:
1017         (-[WebItemProviderRegistrationInfoList dealloc]): Release
1018         `_teamData` to fix leak.
1019
1020 2018-05-25  Antoine Quint  <graouts@apple.com>
1021
1022         [Web Animations] WebAnimation objects never get destroyed
1023         https://bugs.webkit.org/show_bug.cgi?id=185917
1024         <rdar://problem/39539371>
1025
1026         Reviewed by Dean Jackson and Antti Koivisto.
1027
1028         The AnimationTimeline class keeps references to WebAnimation objects organized in various ways. First, there
1029         are three main maps across which all animations are stored, one for non-subclass WebAnimation objects
1030         (m_elementToAnimationsMap), one for CSSSAnimation objects (m_elementToCSSAnimationsMap) and one for CSSTranstion
1031         objects (m_elementToCSSTransitionsMap). On top of that, we also keep a map to access CSSAnimation objects for
1032         a given element by CSS animation name (m_elementToCSSAnimationByName) and another map to access CSSTransition 
1033         objects for a given element by CSS property (m_elementToCSSTransitionByCSSPropertyID).
1034
1035         None of the RefPtr<WebAnimation> stored in these maps would get cleared when the document would get torn down,
1036         which would also prevent the AnimationTimeline (and its DocumentTimeline subclass) from being destroyed.
1037
1038         We now ensure that element and document tear-down correctly removes animations and clears those maps, which
1039         in turn allows the DocumentTimeline to be destroyed, fixing the significant memory leak introduced by Web Animations
1040         so far.
1041
1042         Finally, we change the collection type for those maps to be ListHashRef instead of Vector to guarantee we only
1043         add an animation once per collection due to changes in how setEffect() and setTimeline() operate.
1044
1045         Test: animations/leak-document-with-css-animation.html
1046
1047         * animation/AnimationTimeline.cpp:
1048         (WebCore::AnimationTimeline::~AnimationTimeline): There is no need to clear those tables as they'll need to be empty
1049         for the AnimationTimeline to even be destroyed.
1050         (WebCore::AnimationTimeline::relevantMapForAnimation): Change to use ListHashRef instead of Vector.
1051         (WebCore::AnimationTimeline::animationWasAddedToElement): Change to use ListHashRef instead of Vector.
1052         (WebCore::AnimationTimeline::animationWasRemovedFromElement): When an animation is removed from an element, ensure that
1053         references to this animation stored in the m_elementToCSSAnimationByName and m_elementToCSSTransitionByCSSPropertyID maps
1054         are cleared.
1055         (WebCore::AnimationTimeline::animationsForElement const): Change to use ListHashRef instead of Vector.
1056         (WebCore::AnimationTimeline::removeAnimationsForElement): Instead of just calling cancel() on all known declarative animations
1057         (this method used to be called cancelDeclarativeAnimationsForElement()), we now set the effect of known animations, declarative
1058         or not, for the provided element which will in turn call animationWasRemovedFromElement() and remove the animation from all
1059         maps that might keep a reference to it.
1060         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Replace call to removeDeclarativeAnimation() with a simple call
1061         to removeAnimation() which will remove references for this animation from the relevant maps.
1062         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Ditto.
1063         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement): Deleted.
1064         (WebCore::AnimationTimeline::removeDeclarativeAnimation): Deleted.
1065         * animation/AnimationTimeline.h:
1066         (WebCore::AnimationTimeline::elementToAnimationsMap): Change to use ListHashRef instead of Vector.
1067         (WebCore::AnimationTimeline::elementToCSSAnimationsMap): Change to use ListHashRef instead of Vector.
1068         (WebCore::AnimationTimeline::elementToCSSTransitionsMap): Change to use ListHashRef instead of Vector.
1069         * animation/WebAnimation.cpp:
1070         (WebCore::WebAnimation::setEffect): In the case of a declarative animation, we don't want to remove the animation from the relevant
1071         maps because while the effect was set via the API, the element still has a transition or animation set up and we must not break the
1072         timeline-to-animation relationship.
1073         (WebCore::WebAnimation::setEffectInternal): Factor parts of setEffect() out into a new method that can be called from
1074         AnimationTimeline::removeAnimationsForElement() to reset the m_effect member and correctly call animationWasRemovedFromElement()
1075         without all the Web Animations machinery of setEffect(), which is a public API that has unwanted side effects (such as rejecting
1076         promises).
1077         (WebCore::WebAnimation::setTimeline): In the case of a declarative animation, we don't want to remove the animation from the
1078         relevant maps because, while the timeline was set via the API, the element still has a transition or animation set up and we must
1079         not break the relationship.
1080         * animation/DocumentTimeline.cpp:
1081         (WebCore::DocumentTimeline::~DocumentTimeline):
1082         (WebCore::DocumentTimeline::detachFromDocument): Close the GenericTaskQueues when detaching from the document as it's too late to
1083         perform this work in the destructor. We also cancel the schedule timer which we had forgotten to do before.
1084         * animation/WebAnimation.h:
1085         * dom/Document.cpp:
1086         (WebCore::Document::prepareForDestruction):
1087         * dom/Element.cpp:
1088         (WebCore::Element::removedFromAncestor):
1089         * dom/PseudoElement.cpp:
1090         (WebCore::PseudoElement::clearHostElement):
1091         * rendering/updating/RenderTreeUpdater.cpp:
1092         (WebCore::RenderTreeUpdater::tearDownRenderers):
1093
1094 2018-05-24  Chris Dumez  <cdumez@apple.com>
1095
1096         Avoid doing unnecessary work in Document::shouldEnforceContentDispositionAttachmentSandbox() when setting is disabled
1097         https://bugs.webkit.org/show_bug.cgi?id=185964
1098
1099         Reviewed by Geoffrey Garen.
1100
1101         * dom/Document.cpp:
1102         (WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox const):
1103
1104 2018-05-24  Chris Dumez  <cdumez@apple.com>
1105
1106         [iOS] Avoid dlopening QuickLooks in the common case where the main resource is HTML or plain text
1107         https://bugs.webkit.org/show_bug.cgi?id=185966
1108
1109         Reviewed by Geoffrey Garen.
1110
1111         Avoid dlopening QuickLooks in the common case where the main resource is HTML or plain text
1112         for performance reasons.
1113
1114         * loader/ios/PreviewLoader.mm:
1115         (WebCore::PreviewLoader::shouldCreateForMIMEType):
1116
1117 2018-05-24  Sam Weinig  <sam@webkit.org>
1118
1119         Modernize RenderStyleConstants.h - Part 2
1120         https://bugs.webkit.org/show_bug.cgi?id=185901
1121
1122         Reviewed by Simon Fraser.
1123
1124         Modernized the second set of enums in RenderStyleConstants.h by:
1125             - Converting them to enum classes
1126             - Renaming them to remove unnecessary prefix 'E's
1127             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
1128             - Renaming to match modern conventions (e.g BNONE -> None)
1129             - Reformatting them so that each value is on its own line.
1130
1131         Modernizes the following enums:
1132             PseudoId
1133             ListStyleType (renamed from EListStyleType)
1134             BorderFit (renamed from EBorderFit)
1135             AnimationFillMode (renamed from EAnimationFillMode)
1136             AnimationPlayState (renamed from EAnimPlayState)
1137             WhiteSpace (renamed from EWhiteSpace)
1138             TextAlignMode (renamed from ETextAlign)
1139             TextTransform (renamed from ETextTransform)
1140             TextDecorationStyle
1141             TextAlignLast
1142             TextJustify
1143             TextZoom
1144             BreakBetween
1145             BreakInside
1146             EmptyCell (renamed from EEmptyCell)
1147             CaptionSide (renamed from ECaptionSide)
1148             ListStylePosition (renamed from EListStylePosition)
1149             Visibility (renamed from EVisibility)
1150             CursorType (renamed from ECursor)
1151             CursorVisibility
1152             DisplayType (renamed from EDisplay)
1153             InsideLink (renamed from EInsideLink)
1154             PointerEvents (renamed from EPointerEvents)
1155             Hyphens
1156             TextEmphasisFill
1157             TextEmphasisMark
1158             ImageResolutionSource
1159             ImageResolutionSnap
1160             Order
1161             ColumnAxis
1162             ColumnProgression
1163             LineSnap
1164             LineAlign
1165             RubyPosition
1166             AutoRepeatType
1167             CSSBoxType
1168
1169         * accessibility/AXObjectCache.cpp:
1170         (WebCore::AXObjectCache::isNodeVisible const):
1171         * accessibility/AccessibilityList.cpp:
1172         (WebCore::AccessibilityList::determineAccessibilityRole):
1173         * accessibility/AccessibilityMediaControls.cpp:
1174         (WebCore::AccessibilityMediaControl::computeAccessibilityIsIgnored const):
1175         (WebCore::AccessibilityMediaTimeDisplay::computeAccessibilityIsIgnored const):
1176         * accessibility/AccessibilityObject.cpp:
1177         (WebCore::AccessibilityObject::isDOMHidden const):
1178         * accessibility/AccessibilityRenderObject.cpp:
1179         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
1180         (WebCore::AccessibilityRenderObject::isUnvisited const):
1181         (WebCore::AccessibilityRenderObject::isVisited const):
1182         (WebCore::AccessibilityRenderObject::setValue):
1183         * accessibility/AccessibilityTable.cpp:
1184         (WebCore::AccessibilityTable::isDataTable const):
1185         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1186         (getAttributeSetForAccessibilityObject):
1187         * animation/AnimationTimeline.cpp:
1188         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
1189         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
1190         * animation/CSSAnimation.cpp:
1191         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
1192         * animation/DeclarativeAnimation.cpp:
1193         (WebCore::DeclarativeAnimation::initialize):
1194         * animation/KeyframeEffectReadOnly.cpp:
1195         (WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const):
1196         * css/CSSComputedStyleDeclaration.cpp:
1197         (WebCore::renderTextDecorationStyleFlagsToCSSValue):
1198         (WebCore::convertToPageBreak):
1199         (WebCore::convertToColumnBreak):
1200         (WebCore::ComputedStyleExtractor::styledElement const):
1201         (WebCore::ComputedStyleExtractor::styledRenderer const):
1202         (WebCore::computeRenderStyleForProperty):
1203         (WebCore::shapePropertyValue):
1204         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1205         * css/CSSComputedStyleDeclaration.h:
1206         * css/CSSPrimitiveValueMappings.h:
1207         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1208         (WebCore::CSSPrimitiveValue::operator CaptionSide const):
1209         (WebCore::CSSPrimitiveValue::operator CursorType const):
1210         (WebCore::CSSPrimitiveValue::operator CursorVisibility const):
1211         (WebCore::CSSPrimitiveValue::operator DisplayType const):
1212         (WebCore::CSSPrimitiveValue::operator EmptyCell const):
1213         (WebCore::CSSPrimitiveValue::operator ListStylePosition const):
1214         (WebCore::CSSPrimitiveValue::operator ListStyleType const):
1215         (WebCore::CSSPrimitiveValue::operator BreakBetween const):
1216         (WebCore::CSSPrimitiveValue::operator BreakInside const):
1217         (WebCore::CSSPrimitiveValue::operator TextAlignMode const):
1218         (WebCore::CSSPrimitiveValue::operator TextAlignLast const):
1219         (WebCore::CSSPrimitiveValue::operator TextJustify const):
1220         (WebCore::CSSPrimitiveValue::operator TextDecorationStyle const):
1221         (WebCore::CSSPrimitiveValue::operator TextTransform const):
1222         (WebCore::CSSPrimitiveValue::operator Visibility const):
1223         (WebCore::CSSPrimitiveValue::operator WhiteSpace const):
1224         (WebCore::CSSPrimitiveValue::operator RubyPosition const):
1225         (WebCore::CSSPrimitiveValue::operator TextEmphasisFill const):
1226         (WebCore::CSSPrimitiveValue::operator TextEmphasisMark const):
1227         (WebCore::CSSPrimitiveValue::operator PointerEvents const):
1228         (WebCore::CSSPrimitiveValue::operator Hyphens const):
1229         (WebCore::CSSPrimitiveValue::operator LineSnap const):
1230         (WebCore::CSSPrimitiveValue::operator LineAlign const):
1231         (WebCore::CSSPrimitiveValue::operator Order const):
1232         (WebCore::CSSPrimitiveValue::operator BorderFit const):
1233         (WebCore::CSSPrimitiveValue::operator ColumnAxis const):
1234         (WebCore::CSSPrimitiveValue::operator ColumnProgression const):
1235         (WebCore::CSSPrimitiveValue::operator CSSBoxType const):
1236         (WebCore::CSSPrimitiveValue::operator TextZoom const):
1237         (WebCore::CSSPrimitiveValue::operator ECaptionSide const): Deleted.
1238         (WebCore::CSSPrimitiveValue::operator ECursor const): Deleted.
1239         (WebCore::CSSPrimitiveValue::operator EDisplay const): Deleted.
1240         (WebCore::CSSPrimitiveValue::operator EEmptyCell const): Deleted.
1241         (WebCore::CSSPrimitiveValue::operator EListStylePosition const): Deleted.
1242         (WebCore::CSSPrimitiveValue::operator EListStyleType const): Deleted.
1243         (WebCore::CSSPrimitiveValue::operator ETextAlign const): Deleted.
1244         (WebCore::CSSPrimitiveValue::operator ETextTransform const): Deleted.
1245         (WebCore::CSSPrimitiveValue::operator EVisibility const): Deleted.
1246         (WebCore::CSSPrimitiveValue::operator EWhiteSpace const): Deleted.
1247         (WebCore::CSSPrimitiveValue::operator EPointerEvents const): Deleted.
1248         (WebCore::CSSPrimitiveValue::operator EBorderFit const): Deleted.
1249         * css/CSSSelector.cpp:
1250         (WebCore::CSSSelector::pseudoId):
1251         * css/CSSToStyleMap.cpp:
1252         (WebCore::CSSToStyleMap::mapAnimationFillMode):
1253         (WebCore::CSSToStyleMap::mapAnimationPlayState):
1254         * css/CSSValueKeywords.in:
1255         * css/ElementRuleCollector.cpp:
1256         (WebCore::ElementRuleCollector::collectMatchingRules):
1257         (WebCore::ElementRuleCollector::ruleMatches):
1258         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1259         * css/ElementRuleCollector.h:
1260         * css/SelectorChecker.cpp:
1261         (WebCore::SelectorChecker::match const):
1262         (WebCore::SelectorChecker::matchHostPseudoClass const):
1263         (WebCore::hasScrollbarPseudoElement):
1264         (WebCore::SelectorChecker::matchRecursively const):
1265         * css/SelectorChecker.h:
1266         * css/StyleBuilderConverter.h:
1267         (WebCore::StyleBuilderConverter::convertTextAlign):
1268         (WebCore::StyleBuilderConverter::convertClipPath):
1269         (WebCore::StyleBuilderConverter::convertShapeValue):
1270         (WebCore::StyleBuilderConverter::createGridTrackList):
1271         (WebCore::StyleBuilderConverter::csstoLengthConversionDataWithTextZoomFactor):
1272         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
1273         (WebCore::StyleBuilderConverter::convertPageBreakInside):
1274         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
1275         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
1276         * css/StyleBuilderCustom.h:
1277         (WebCore::StyleBuilderCustom::applyValueImageResolution):
1278         (WebCore::computeBaseSpecifiedFontSize):
1279         (WebCore::StyleBuilderCustom::applyValueWebkitTextZoom):
1280         (WebCore::StyleBuilderCustom::isValidDisplayValue):
1281         (WebCore::StyleBuilderCustom::applyInheritDisplay):
1282         (WebCore::StyleBuilderCustom::applyValueDisplay):
1283         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
1284         (WebCore::StyleBuilderCustom::applyValueCursor):
1285         (WebCore::StyleBuilderCustom::applyValueContent):
1286         (WebCore::StyleBuilderCustom::determineRubyTextSizeMultiplier):
1287         (WebCore::StyleBuilderCustom::applyValueAlt):
1288         * css/StyleResolver.cpp:
1289         (WebCore::StyleResolver::styleForElement):
1290         (WebCore::equivalentBlockDisplay):
1291         (WebCore::doesNotInheritTextDecoration):
1292         (WebCore::StyleResolver::adjustStyleForInterCharacterRuby):
1293         (WebCore::adjustDisplayContentsStyle):
1294         (WebCore::StyleResolver::adjustSVGElementStyle):
1295         (WebCore::StyleResolver::adjustRenderStyle):
1296         (WebCore::StyleResolver::styleRulesForElement):
1297         (WebCore::isCacheableInMatchedPropertiesCache):
1298         (WebCore::StyleResolver::applyMatchedProperties):
1299         (WebCore::StyleResolver::CascadedProperties::Property::apply):
1300         * css/StyleResolver.h:
1301         (WebCore::StyleResolver::State::elementLinkState const):
1302         * cssjit/SelectorCompiler.cpp:
1303         (WebCore::SelectorCompiler::constructFragmentsInternal):
1304         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
1305         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateMarkPseudoStyleForPseudoElement):
1306         * dom/Document.cpp:
1307         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
1308         (WebCore::Document::isPageBoxVisible):
1309         (WebCore::Document::setVisuallyOrdered):
1310         * dom/Document.h:
1311         * dom/Element.cpp:
1312         (WebCore::Element::isFocusable const):
1313         (WebCore::Element::hasDisplayContents const):
1314         (WebCore::Element::storeDisplayContentsStyle):
1315         (WebCore::Element::rendererIsNeeded):
1316         (WebCore::beforeOrAfterPseudoElement):
1317         (WebCore::Element::computedStyle):
1318         * dom/Element.h:
1319         * dom/Node.cpp:
1320         (WebCore::computeEditabilityFromComputedStyle):
1321         * dom/Node.h:
1322         (WebCore::Node::isPseudoElement const):
1323         (WebCore::Node::isBeforePseudoElement const):
1324         (WebCore::Node::isAfterPseudoElement const):
1325         (WebCore::Node::pseudoId const):
1326         (WebCore::Node::customPseudoId const):
1327         * dom/Position.cpp:
1328         (WebCore::Position::upstream const):
1329         (WebCore::Position::downstream const):
1330         (WebCore::Position::isCandidate const):
1331         (WebCore::Position::rendersInDifferentPosition const):
1332         * dom/PositionIterator.cpp:
1333         (WebCore::PositionIterator::isCandidate const):
1334         * dom/PseudoElement.cpp:
1335         (WebCore::PseudoElement::pseudoElementNameForEvents):
1336         (WebCore::PseudoElement::PseudoElement):
1337         * dom/VisitedLinkState.cpp:
1338         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
1339         * dom/VisitedLinkState.h:
1340         (WebCore::VisitedLinkState::determineLinkState):
1341         * editing/Editing.cpp:
1342         (WebCore::isSpecialHTMLElement):
1343         (WebCore::isNodeRendered):
1344         * editing/TextIterator.cpp:
1345         (WebCore::hasVisibleTextNode):
1346         (WebCore::TextIterator::handleTextNode):
1347         (WebCore::TextIterator::handleTextBox):
1348         (WebCore::TextIterator::handleTextNodeFirstLetter):
1349         (WebCore::TextIterator::handleReplacedElement):
1350         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
1351         (WebCore::SimplifiedBackwardsTextIterator::advance):
1352         * editing/VisibleUnits.cpp:
1353         (WebCore::findStartOfParagraph):
1354         (WebCore::findEndOfParagraph):
1355         * editing/ios/EditorIOS.mm:
1356         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
1357         * html/HTMLAreaElement.cpp:
1358         (WebCore::HTMLAreaElement::isFocusable const):
1359         * html/HTMLFormElement.cpp:
1360         (WebCore::HTMLFormElement::rendererIsNeeded):
1361         * html/HTMLIFrameElement.cpp:
1362         (WebCore::HTMLIFrameElement::rendererIsNeeded):
1363         * html/HTMLInputElement.cpp:
1364         (WebCore::HTMLInputElement::createInnerTextStyle):
1365         * html/HTMLOptGroupElement.cpp:
1366         (WebCore::HTMLOptGroupElement::isFocusable const):
1367         * html/HTMLOptionElement.cpp:
1368         (WebCore::HTMLOptionElement::isFocusable const):
1369         * html/HTMLTextAreaElement.cpp:
1370         (WebCore::HTMLTextAreaElement::createInnerTextStyle):
1371         * html/HTMLTextFormControlElement.cpp:
1372         (WebCore::HTMLTextFormControlElement::setSelectionRange):
1373         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
1374         * html/MediaElementSession.cpp:
1375         (WebCore::MediaElementSession::autoplayPermitted const):
1376         (WebCore::isMainContentForPurposesOfAutoplay):
1377         * html/RubyElement.cpp:
1378         (WebCore::RubyElement::createElementRenderer):
1379         * html/RubyTextElement.cpp:
1380         (WebCore::RubyTextElement::createElementRenderer):
1381         * html/shadow/TextControlInnerElements.cpp:
1382         (WebCore::TextControlInnerElement::resolveCustomStyle):
1383         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
1384         * inspector/InspectorOverlay.cpp:
1385         (WebCore::buildObjectForElementData):
1386         * inspector/agents/InspectorCSSAgent.cpp:
1387         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
1388         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
1389         * inspector/agents/InspectorDOMAgent.cpp:
1390         (WebCore::pseudoElementType):
1391         (WebCore::InspectorDOMAgent::buildObjectForNode):
1392         * inspector/agents/InspectorLayerTreeAgent.cpp:
1393         (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
1394         * layout/layouttree/LayoutBox.cpp:
1395         (WebCore::Layout::Box::isInlineBlockBox const):
1396         (WebCore::Layout::Box::isBlockLevelBox const):
1397         (WebCore::Layout::Box::isInlineLevelBox const):
1398         (WebCore::Layout::Box::isBlockContainerBox const):
1399         * page/EventHandler.cpp:
1400         (WebCore::EventHandler::selectCursor):
1401         * page/Frame.cpp:
1402         (WebCore::Frame::searchForLabelsAboveCell):
1403         (WebCore::Frame::searchForLabelsBeforeElement):
1404         * page/FrameView.cpp:
1405         (WebCore::FrameView::createScrollbar):
1406         (WebCore::FrameView::adjustScrollStepForFixedContent):
1407         (WebCore::FrameView::updateScrollCorner):
1408         * page/animation/AnimationBase.cpp:
1409         (WebCore::AnimationBase::playStatePlaying const):
1410         (WebCore::AnimationBase::updatePlayState):
1411         * page/animation/AnimationBase.h:
1412         * page/animation/CSSPropertyAnimation.cpp:
1413         (WebCore::blendFunc):
1414         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1415         * page/animation/CompositeAnimation.cpp:
1416         (WebCore::CompositeAnimation::updateTransitions):
1417         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1418         (WebCore::CompositeAnimation::suspendAnimations):
1419         (WebCore::CompositeAnimation::resumeAnimations):
1420         * page/animation/KeyframeAnimation.cpp:
1421         (WebCore::KeyframeAnimation::animate):
1422         * page/ios/FrameIOS.mm:
1423         (WebCore::Frame::nodeRespondingToClickEvents):
1424         * platform/animation/Animation.cpp:
1425         (WebCore::Animation::Animation):
1426         * platform/animation/Animation.h:
1427         (WebCore::Animation::clearPlayState):
1428         (WebCore::Animation::fillMode const):
1429         (WebCore::Animation::playState const):
1430         (WebCore::Animation::setFillMode):
1431         (WebCore::Animation::setPlayState):
1432         (WebCore::Animation::fillsBackwards const):
1433         (WebCore::Animation::fillsForwards const):
1434         (WebCore::Animation::initialFillMode):
1435         (WebCore::Animation::initialPlayState):
1436         * platform/graphics/GraphicsTypes.h:
1437         * platform/graphics/ca/GraphicsLayerCA.cpp:
1438         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1439         * platform/ios/wak/WAKWindow.mm:
1440         (-[WAKWindow dumpTiles]):
1441         * platform/mac/WebCoreNSURLExtras.mm:
1442         (WebCore::isLookalikeCharacter):
1443         * rendering/ClipPathOperation.h:
1444         * rendering/InlineBox.h:
1445         (WebCore::InlineBox::visibleToHitTesting const):
1446         * rendering/InlineFlowBox.cpp:
1447         (WebCore::InlineFlowBox::addToLine):
1448         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
1449         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
1450         (WebCore::InlineFlowBox::paint):
1451         (WebCore::InlineFlowBox::paintBoxDecorations):
1452         (WebCore::InlineFlowBox::paintMask):
1453         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
1454         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
1455         (WebCore::InlineFlowBox::collectLeafBoxesInLogicalOrder const):
1456         * rendering/InlineFlowBox.h:
1457         (WebCore::InlineFlowBox::InlineFlowBox):
1458         * rendering/InlineTextBox.cpp:
1459         (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
1460         (WebCore::InlineTextBox::paint):
1461         (WebCore::InlineTextBox::createTextRun const):
1462         * rendering/PointerEventsHitRules.cpp:
1463         (WebCore::PointerEventsHitRules::PointerEventsHitRules):
1464         * rendering/PointerEventsHitRules.h:
1465         * rendering/RenderBlock.cpp:
1466         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
1467         (WebCore::RenderBlock::paint):
1468         (WebCore::RenderBlock::paintObject):
1469         (WebCore::RenderBlock::shouldPaintSelectionGaps const):
1470         (WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
1471         (WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
1472         (WebCore::isChildHitTestCandidate):
1473         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
1474         (WebCore::RenderBlock::firstLineBlock const):
1475         (WebCore::findFirstLetterBlock):
1476         (WebCore::RenderBlock::getFirstLetter):
1477         (WebCore::RenderBlock::createAnonymousBlockWithStyleAndDisplay):
1478         (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
1479         (WebCore::RenderBlock::constructTextRun):
1480         (WebCore::RenderBlock::layoutExcludedChildren):
1481         * rendering/RenderBlock.h:
1482         (WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay):
1483         (WebCore::RenderBlock::createAnonymousBlock const):
1484         * rendering/RenderBlockFlow.cpp:
1485         (WebCore::RenderBlockFlow::willCreateColumns const):
1486         (WebCore::RenderBlockFlow::layoutBlock):
1487         (WebCore::RenderBlockFlow::applyBeforeBreak):
1488         (WebCore::RenderBlockFlow::applyAfterBreak):
1489         (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
1490         (WebCore::RenderBlockFlow::updateStylesForColumnChildren):
1491         (WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
1492         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
1493         (WebCore::RenderBlockFlow::adjustForBorderFit const):
1494         (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
1495         (WebCore::RenderBlockFlow::lineAtIndex const):
1496         (WebCore::RenderBlockFlow::lineCount const):
1497         (WebCore::getHeightForLineCount):
1498         (WebCore::RenderBlockFlow::clearTruncation):
1499         (WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
1500         (WebCore::RenderBlockFlow::lineCountForTextAutosizing):
1501         (WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):
1502         (WebCore::RenderBlockFlow::updateColumnProgressionFromStyle):
1503         (WebCore::RenderBlockFlow::isTopLayoutOverflowAllowed const):
1504         (WebCore::RenderBlockFlow::isLeftLayoutOverflowAllowed const):
1505         * rendering/RenderBlockFlow.h:
1506         * rendering/RenderBlockLineLayout.cpp:
1507         (WebCore::RenderBlockFlow::constructLine):
1508         (WebCore::RenderBlockFlow::textAlignmentForLine const):
1509         (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
1510         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
1511         (WebCore::expansionBehaviorForInlineTextBox):
1512         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1513         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1514         (WebCore::RenderBlockFlow::checkFloatInCleanLine):
1515         (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
1516         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
1517         (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
1518         * rendering/RenderBox.cpp:
1519         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
1520         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
1521         (WebCore::isCandidateForOpaquenessTest):
1522         (WebCore::RenderBox::paintMask):
1523         (WebCore::RenderBox::paintClippingMask):
1524         (WebCore::RenderBox::positionLineBox):
1525         (WebCore::RenderBox::clippedOverflowRectForRepaint const):
1526         (WebCore::RenderBox::computeLogicalWidthInFragment const):
1527         (WebCore::RenderBox::computeInlineDirectionMargins const):
1528         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation const):
1529         (WebCore::RenderBox::positionForPoint):
1530         (WebCore::RenderBox::isUnsplittableForPagination const):
1531         * rendering/RenderBoxModelObject.cpp:
1532         (WebCore::RenderBoxModelObject::localCaretRectForEmptyElement):
1533         * rendering/RenderBoxModelObject.h:
1534         * rendering/RenderCounter.cpp:
1535         (WebCore::planCounter):
1536         (WebCore::RenderCounter::originalText const):
1537         * rendering/RenderDeprecatedFlexibleBox.cpp:
1538         (WebCore::childDoesNotAffectWidthOrFlexing):
1539         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1540         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
1541         * rendering/RenderDetailsMarker.cpp:
1542         (WebCore::RenderDetailsMarker::paint):
1543         * rendering/RenderElement.cpp:
1544         (WebCore::RenderElement::createFor):
1545         (WebCore::RenderElement::computeFirstLineStyle const):
1546         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
1547         (WebCore::RenderElement::styleWillChange):
1548         (WebCore::RenderElement::insertedIntoTree):
1549         (WebCore::RenderElement::willBeRemovedFromTree):
1550         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
1551         (WebCore::RenderElement::isVisibleInDocumentRect const):
1552         (WebCore::RenderElement::getCachedPseudoStyle const):
1553         (WebCore::RenderElement::getUncachedPseudoStyle const):
1554         (WebCore::RenderElement::selectionPseudoStyle const):
1555         * rendering/RenderElement.h:
1556         (WebCore::RenderElement::visibleToHitTesting const):
1557         * rendering/RenderFileUploadControl.cpp:
1558         (WebCore::RenderFileUploadControl::paintObject):
1559         * rendering/RenderFullScreen.cpp:
1560         (WebCore::createFullScreenStyle):
1561         * rendering/RenderGrid.cpp:
1562         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const):
1563         * rendering/RenderImage.cpp:
1564         (WebCore::RenderImage::repaintOrMarkForLayout):
1565         * rendering/RenderInline.cpp:
1566         (WebCore::RenderInline::willBeDestroyed):
1567         (WebCore::updateStyleOfAnonymousBlockContinuations):
1568         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
1569         (WebCore::RenderInline::clippedOverflowRectForRepaint const):
1570         (WebCore::RenderInline::addAnnotatedRegions):
1571         * rendering/RenderLayer.cpp:
1572         (WebCore::RenderLayer::RenderLayer):
1573         (WebCore::RenderLayer::updateDescendantDependentFlags):
1574         (WebCore::RenderLayer::createScrollbar):
1575         (WebCore::styleRequiresScrollbar):
1576         (WebCore::styleDefinesAutomaticScrollbar):
1577         (WebCore::computeReferenceBox):
1578         (WebCore::RenderLayer::calculateClipRects const):
1579         * rendering/RenderLayerBacking.cpp:
1580         (WebCore::RenderLayerBacking::updateAfterDescendants):
1581         * rendering/RenderLayerCompositor.cpp:
1582         (WebCore::scrollbarHasDisplayNone):
1583         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
1584         (WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
1585         * rendering/RenderListBox.cpp:
1586         (WebCore::RenderListBox::paintObject):
1587         (WebCore::itemOffsetForAlignment):
1588         (WebCore::RenderListBox::paintItemForeground):
1589         (WebCore::RenderListBox::paintItemBackground):
1590         (WebCore::RenderListBox::createScrollbar):
1591         * rendering/RenderListItem.cpp:
1592         (WebCore::RenderListItem::computeMarkerStyle const):
1593         * rendering/RenderListMarker.cpp:
1594         (WebCore::effectiveListMarkerType):
1595         (WebCore::listMarkerSuffix):
1596         (WebCore::listMarkerText):
1597         (WebCore::RenderListMarker::paint):
1598         (WebCore::RenderListMarker::updateContent):
1599         (WebCore::RenderListMarker::computePreferredLogicalWidths):
1600         (WebCore::RenderListMarker::updateMargins):
1601         (WebCore::RenderListMarker::suffix const):
1602         (WebCore::RenderListMarker::isInside const):
1603         (WebCore::RenderListMarker::getRelativeMarkerRect):
1604         * rendering/RenderListMarker.h:
1605         * rendering/RenderMediaControlElements.cpp:
1606         (WebCore::RenderMediaVolumeSliderContainer::layout):
1607         (WebCore::RenderTextTrackContainerElement::layout):
1608         * rendering/RenderMenuList.cpp:
1609         (WebCore::RenderMenuList::adjustInnerStyle):
1610         (WebCore::if):
1611         (RenderMenuList::itemStyle const):
1612         (RenderMenuList::menuStyle const):
1613         (RenderMenuList::createScrollbar):
1614         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
1615         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
1616         * rendering/RenderObject.cpp:
1617         (WebCore::RenderObject::addAnnotatedRegions):
1618         * rendering/RenderObject.h:
1619         (WebCore::RenderObject::isAnonymousBlock const):
1620         (WebCore::RenderObject::isBeforeContent const):
1621         (WebCore::RenderObject::isAfterContent const):
1622         * rendering/RenderReplaced.cpp:
1623         (WebCore::RenderReplaced::shouldPaint):
1624         (WebCore::RenderReplaced::clippedOverflowRectForRepaint const):
1625         * rendering/RenderRubyBase.cpp:
1626         (WebCore::RenderRubyBase::textAlignmentForLine const):
1627         * rendering/RenderRubyBase.h:
1628         * rendering/RenderRubyRun.cpp:
1629         (WebCore::RenderRubyRun::createRubyBase const):
1630         (WebCore::RenderRubyRun::staticCreateRubyRun):
1631         (WebCore::RenderRubyRun::layoutBlock):
1632         * rendering/RenderRubyText.cpp:
1633         (WebCore::RenderRubyText::textAlignmentForLine const):
1634         (WebCore::RenderRubyText::adjustInlineDirectionLineBounds const):
1635         * rendering/RenderRubyText.h:
1636         * rendering/RenderScrollbar.cpp:
1637         (WebCore::pseudoForScrollbarPart):
1638         (WebCore::RenderScrollbar::updateScrollbarPart):
1639         * rendering/RenderSearchField.cpp:
1640         (WebCore::RenderSearchField::updateCancelButtonVisibility const):
1641         (WebCore::RenderSearchField::visibilityForCancelButton const):
1642         (WebCore::RenderSearchField::menuStyle const):
1643         (WebCore::RenderSearchField::createScrollbar):
1644         * rendering/RenderSearchField.h:
1645         * rendering/RenderTable.cpp:
1646         (WebCore::RenderTable::willInsertTableSection):
1647         (WebCore::RenderTable::layoutCaptions):
1648         (WebCore::RenderTable::layout):
1649         (WebCore::RenderTable::paintObject):
1650         (WebCore::RenderTable::adjustBorderBoxRectForPainting):
1651         (WebCore::RenderTable::paintMask):
1652         (WebCore::RenderTable::recalcSections const):
1653         (WebCore::RenderTable::createTableWithStyle):
1654         * rendering/RenderTableCell.cpp:
1655         (WebCore::RenderTableCell::styleDidChange):
1656         (WebCore::RenderTableCell::paintCollapsedBorders):
1657         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
1658         (WebCore::RenderTableCell::paintBoxDecorations):
1659         (WebCore::RenderTableCell::paintMask):
1660         (WebCore::RenderTableCell::createTableCellWithStyle):
1661         * rendering/RenderTableCol.cpp:
1662         (WebCore::RenderTableCol::updateFromElement):
1663         (WebCore::RenderTableCol::isChildAllowed const):
1664         * rendering/RenderTableCol.h:
1665         * rendering/RenderTableRow.cpp:
1666         (WebCore::RenderTableRow::styleDidChange):
1667         (WebCore::RenderTableRow::paintOutlineForRowIfNeeded):
1668         (WebCore::RenderTableRow::createTableRowWithStyle):
1669         * rendering/RenderTableSection.cpp:
1670         (WebCore::RenderTableSection::addCell):
1671         (WebCore::RenderTableSection::paint):
1672         (WebCore::RenderTableSection::createTableSectionWithStyle):
1673         * rendering/RenderText.cpp:
1674         (WebCore::RenderText::styleDidChange):
1675         (WebCore::RenderText::computePreferredLogicalWidths):
1676         (WebCore::applyTextTransform):
1677         * rendering/RenderTextFragment.cpp:
1678         (WebCore::RenderTextFragment::styleDidChange):
1679         (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
1680         * rendering/RenderTheme.cpp:
1681         (WebCore::RenderTheme::adjustStyle):
1682         * rendering/RenderThemeMac.mm:
1683         (WebCore::RenderThemeMac::adjustMenuListStyle const):
1684         * rendering/RenderThemeWin.cpp:
1685         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
1686         * rendering/RenderView.cpp:
1687         (WebCore::rendererObscuresBackground):
1688         * rendering/RenderWidget.cpp:
1689         (WebCore::RenderWidget::setWidget):
1690         (WebCore::RenderWidget::styleDidChange):
1691         * rendering/RootInlineBox.cpp:
1692         (WebCore::RootInlineBox::paintEllipsisBox const):
1693         (WebCore::RootInlineBox::lineSnapAdjustment const):
1694         (WebCore::RootInlineBox::lineSelectionGap):
1695         (WebCore::RootInlineBox::computeCaretRect const):
1696         * rendering/SimpleLineLayout.cpp:
1697         (WebCore::SimpleLineLayout::canUseForFontAndText):
1698         (WebCore::SimpleLineLayout::canUseForStyle):
1699         (WebCore::SimpleLineLayout::computeLineLeft):
1700         (WebCore::SimpleLineLayout::updateLineConstrains):
1701         (WebCore::SimpleLineLayout::createLineRuns):
1702         (WebCore::SimpleLineLayout::textAlignForLine):
1703         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
1704         * rendering/SimpleLineLayoutFunctions.cpp:
1705         (WebCore::SimpleLineLayout::paintFlow):
1706         (WebCore::SimpleLineLayout::hitTestFlow):
1707         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1708         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
1709         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1710         * rendering/TextDecorationPainter.cpp:
1711         (WebCore::textDecorationStyleToStrokeStyle):
1712         (WebCore::TextDecorationPainter::paintTextDecoration):
1713         (WebCore::collectStylesForRenderer):
1714         * rendering/TextDecorationPainter.h:
1715         * rendering/line/BreakingContext.h:
1716         (WebCore::BreakingContext::BreakingContext):
1717         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
1718         (WebCore::BreakingContext::handleBR):
1719         (WebCore::BreakingContext::handleOutOfFlowPositioned):
1720         (WebCore::BreakingContext::handleText):
1721         (WebCore::BreakingContext::canBreakAtThisPosition):
1722         (WebCore::BreakingContext::handleEndOfLine):
1723         * rendering/line/LineInlineHeaders.h:
1724         (WebCore::shouldCollapseWhiteSpace):
1725         * rendering/line/LineWidth.cpp:
1726         (WebCore::newFloatShrinksLine):
1727         * rendering/mathml/MathOperator.cpp:
1728         (WebCore::MathOperator::paint):
1729         * rendering/mathml/RenderMathMLFraction.cpp:
1730         (WebCore::RenderMathMLFraction::paint):
1731         * rendering/mathml/RenderMathMLMath.cpp:
1732         (WebCore::RenderMathMLMath::layoutBlock):
1733         * rendering/mathml/RenderMathMLMenclose.cpp:
1734         (WebCore::RenderMathMLMenclose::paint):
1735         * rendering/mathml/RenderMathMLRoot.cpp:
1736         (WebCore::RenderMathMLRoot::paint):
1737         * rendering/mathml/RenderMathMLToken.cpp:
1738         (WebCore::RenderMathMLToken::paint):
1739         * rendering/shapes/BoxShape.cpp:
1740         (WebCore::computeRoundedRectForBoxShape):
1741         * rendering/shapes/ShapeOutsideInfo.cpp:
1742         (WebCore::referenceBox):
1743         (WebCore::ShapeOutsideInfo::setReferenceBoxLogicalSize):
1744         (WebCore::ShapeOutsideInfo::logicalTopOffset const):
1745         (WebCore::ShapeOutsideInfo::logicalLeftOffset const):
1746         * rendering/style/CounterContent.h:
1747         (WebCore::CounterContent::CounterContent):
1748         (WebCore::CounterContent::listStyle const):
1749         * rendering/style/RenderStyle.cpp:
1750         (WebCore::RenderStyle::createAnonymousStyleWithDisplay):
1751         (WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
1752         (WebCore::RenderStyle::RenderStyle):
1753         (WebCore::RenderStyle::hasUniquePseudoStyle const):
1754         (WebCore::RenderStyle::getCachedPseudoStyle const):
1755         (WebCore::RenderStyle::addCachedPseudoStyle):
1756         (WebCore::RenderStyle::changeRequiresLayout const):
1757         (WebCore::requiresPainting):
1758         (WebCore::RenderStyle::hyphenString const):
1759         (WebCore::RenderStyle::textEmphasisMarkString const):
1760         (WebCore::RenderStyle::visitedDependentColor const):
1761         (WebCore::RenderStyle::textEmphasisMark const):
1762         (WebCore::RenderStyle::setColumnStylesFromPaginationMode):
1763         * rendering/style/RenderStyle.h:
1764         (WebCore::RenderStyle::setStyleType):
1765         (WebCore::RenderStyle::setRTLOrdering):
1766         (WebCore::RenderStyle::display const):
1767         (WebCore::RenderStyle::visibility const):
1768         (WebCore::RenderStyle::textAlign const):
1769         (WebCore::RenderStyle::textTransform const):
1770         (WebCore::RenderStyle::whiteSpace const):
1771         (WebCore::RenderStyle::emptyCells const):
1772         (WebCore::RenderStyle::captionSide const):
1773         (WebCore::RenderStyle::listStyleType const):
1774         (WebCore::RenderStyle::listStylePosition const):
1775         (WebCore::RenderStyle::cursor const):
1776         (WebCore::RenderStyle::insideLink const):
1777         (WebCore::RenderStyle::borderFit const):
1778         (WebCore::RenderStyle::pointerEvents const):
1779         (WebCore::RenderStyle::setDisplay):
1780         (WebCore::RenderStyle::setOriginalDisplay):
1781         (WebCore::RenderStyle::setVisibility):
1782         (WebCore::RenderStyle::setTextAlign):
1783         (WebCore::RenderStyle::setTextTransform):
1784         (WebCore::RenderStyle::setTextDecorationStyle):
1785         (WebCore::RenderStyle::setTextDecorationSkip):
1786         (WebCore::RenderStyle::setTextUnderlinePosition):
1787         (WebCore::RenderStyle::setDirection):
1788         (WebCore::RenderStyle::setTextZoom):
1789         (WebCore::RenderStyle::setWhiteSpace):
1790         (WebCore::RenderStyle::setEmptyCells):
1791         (WebCore::RenderStyle::setCaptionSide):
1792         (WebCore::RenderStyle::setListStyleType):
1793         (WebCore::RenderStyle::setListStylePosition):
1794         (WebCore::RenderStyle::setCursor):
1795         (WebCore::RenderStyle::setCursorVisibility):
1796         (WebCore::RenderStyle::setInsideLink):
1797         (WebCore::RenderStyle::setHyphens):
1798         (WebCore::RenderStyle::setBorderFit):
1799         (WebCore::RenderStyle::setColumnAxis):
1800         (WebCore::RenderStyle::setColumnProgression):
1801         (WebCore::RenderStyle::setTextEmphasisFill):
1802         (WebCore::RenderStyle::setTextEmphasisMark):
1803         (WebCore::RenderStyle::setRubyPosition):
1804         (WebCore::RenderStyle::setBreakBefore):
1805         (WebCore::RenderStyle::setBreakAfter):
1806         (WebCore::RenderStyle::setBreakInside):
1807         (WebCore::RenderStyle::setHangingPunctuation):
1808         (WebCore::RenderStyle::setLineSnap):
1809         (WebCore::RenderStyle::setLineAlign):
1810         (WebCore::RenderStyle::setPointerEvents):
1811         (WebCore::RenderStyle::initialDisplay):
1812         (WebCore::RenderStyle::initialBreakBetween):
1813         (WebCore::RenderStyle::initialBreakInside):
1814         (WebCore::RenderStyle::initialCaptionSide):
1815         (WebCore::RenderStyle::initialColumnAxis):
1816         (WebCore::RenderStyle::initialColumnProgression):
1817         (WebCore::RenderStyle::initialEmptyCells):
1818         (WebCore::RenderStyle::initialListStylePosition):
1819         (WebCore::RenderStyle::initialListStyleType):
1820         (WebCore::RenderStyle::initialTextTransform):
1821         (WebCore::RenderStyle::initialVisibility):
1822         (WebCore::RenderStyle::initialWhiteSpace):
1823         (WebCore::RenderStyle::initialCursor):
1824         (WebCore::RenderStyle::initialTextAlign):
1825         (WebCore::RenderStyle::initialTextDecorationStyle):
1826         (WebCore::RenderStyle::initialTextZoom):
1827         (WebCore::RenderStyle::initialHyphens):
1828         (WebCore::RenderStyle::initialBorderFit):
1829         (WebCore::RenderStyle::initialRTLOrdering):
1830         (WebCore::RenderStyle::initialPointerEvents):
1831         (WebCore::RenderStyle::initialTextEmphasisColor):
1832         (WebCore::RenderStyle::initialTextEmphasisFill):
1833         (WebCore::RenderStyle::initialTextEmphasisMark):
1834         (WebCore::RenderStyle::initialRubyPosition):
1835         (WebCore::RenderStyle::initialImageResolutionSource):
1836         (WebCore::RenderStyle::initialImageResolutionSnap):
1837         (WebCore::RenderStyle::initialTextAlignLast):
1838         (WebCore::RenderStyle::initialTextJustify):
1839         (WebCore::RenderStyle::initialCursorVisibility):
1840         (WebCore::RenderStyle::initialGridAutoRepeatType):
1841         (WebCore::RenderStyle::initialLineSnap):
1842         (WebCore::RenderStyle::initialLineAlign):
1843         (WebCore::RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles const):
1844         (WebCore::RenderStyle::originalDisplay const):
1845         (WebCore::RenderStyle::NonInheritedFlags::hasPseudoStyle const):
1846         (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyle):
1847         (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyles):
1848         (WebCore::RenderStyle::autoWrap):
1849         (WebCore::RenderStyle::preserveNewline):
1850         (WebCore::RenderStyle::collapseWhiteSpace):
1851         (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const):
1852         (WebCore::RenderStyle::hasInlineColumnAxis const):
1853         (WebCore::RenderStyle::isDisplayRegionType const):
1854         (WebCore::RenderStyle::isDisplayReplacedType):
1855         (WebCore::RenderStyle::isDisplayInlineType):
1856         (WebCore::RenderStyle::isDisplayFlexibleBox):
1857         (WebCore::RenderStyle::isDisplayGridBox):
1858         (WebCore::RenderStyle::isDisplayFlexibleOrGridBox):
1859         (WebCore::pseudoElementRendererIsNeeded):
1860         * rendering/style/RenderStyleConstants.cpp:
1861         (WebCore::operator<<):
1862         (WebCore::alwaysPageBreak):
1863         * rendering/style/RenderStyleConstants.h:
1864         (WebCore::PseudoIdSet::has const):
1865         (WebCore::PseudoIdSet::add):
1866         * rendering/style/ShapeValue.h:
1867         * rendering/style/StyleMultiColData.cpp:
1868         (WebCore::StyleMultiColData::StyleMultiColData):
1869         * rendering/style/StyleRareInheritedData.cpp:
1870         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1871         * rendering/style/StyleRareNonInheritedData.cpp:
1872         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1873         * rendering/style/StyleRareNonInheritedData.h:
1874         * rendering/svg/RenderSVGContainer.cpp:
1875         (WebCore::RenderSVGContainer::paint):
1876         * rendering/svg/RenderSVGImage.cpp:
1877         (WebCore::RenderSVGImage::paint):
1878         (WebCore::RenderSVGImage::nodeAtFloatPoint):
1879         * rendering/svg/RenderSVGInlineText.cpp:
1880         (WebCore::RenderSVGInlineText::styleDidChange):
1881         * rendering/svg/RenderSVGModelObject.cpp:
1882         (WebCore::RenderSVGModelObject::checkIntersection):
1883         (WebCore::RenderSVGModelObject::checkEnclosure):
1884         * rendering/svg/RenderSVGResource.cpp:
1885         (WebCore::requestPaintingResource):
1886         * rendering/svg/RenderSVGResourceClipper.cpp:
1887         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
1888         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
1889         (WebCore::RenderSVGResourceClipper::calculateClipContentRepaintRect):
1890         * rendering/svg/RenderSVGResourceMasker.cpp:
1891         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
1892         (WebCore::RenderSVGResourceMasker::calculateMaskContentRepaintRect):
1893         * rendering/svg/RenderSVGRoot.cpp:
1894         (WebCore::RenderSVGRoot::clippedOverflowRectForRepaint const):
1895         * rendering/svg/RenderSVGShape.cpp:
1896         (WebCore::RenderSVGShape::paint):
1897         (WebCore::RenderSVGShape::nodeAtFloatPoint):
1898         * rendering/svg/RenderSVGText.cpp:
1899         (WebCore::RenderSVGText::nodeAtFloatPoint):
1900         * rendering/svg/SVGInlineTextBox.cpp:
1901         (WebCore::SVGInlineTextBox::paintSelectionBackground):
1902         (WebCore::SVGInlineTextBox::paint):
1903         (WebCore::SVGInlineTextBox::constructTextRun const):
1904         (WebCore::SVGInlineTextBox::paintDecoration):
1905         (WebCore::SVGInlineTextBox::nodeAtPoint):
1906         * rendering/svg/SVGRenderSupport.cpp:
1907         (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
1908         * rendering/svg/SVGRenderingContext.cpp:
1909         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1910         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
1911         (WebCore::processRenderSVGInlineText):
1912         * rendering/svg/SVGTextMetricsBuilder.cpp:
1913         (WebCore::SVGTextMetricsBuilder::measureTextRenderer):
1914         * rendering/updating/RenderTreeBuilderBlock.cpp:
1915         (WebCore::RenderTreeBuilder::Block::detach):
1916         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
1917         (WebCore::styleForFirstLetter):
1918         (WebCore::RenderTreeBuilder::FirstLetter::updateAfterDescendants):
1919         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
1920         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
1921         * rendering/updating/RenderTreeBuilderInline.cpp:
1922         (WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
1923         (WebCore::RenderTreeBuilder::Inline::newChildIsInline):
1924         * rendering/updating/RenderTreeBuilderList.cpp:
1925         (WebCore::RenderTreeBuilder::List::updateItemMarker):
1926         * rendering/updating/RenderTreeBuilderMathML.cpp:
1927         (WebCore::RenderTreeBuilder::MathML::createMathMLOperator):
1928         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
1929         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
1930         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
1931         * rendering/updating/RenderTreeBuilderRuby.cpp:
1932         (WebCore::isAnonymousRubyInlineBlock):
1933         (WebCore::isRubyBeforeBlock):
1934         (WebCore::isRubyAfterBlock):
1935         (WebCore::createAnonymousRubyInlineBlock):
1936         * rendering/updating/RenderTreeBuilderTable.cpp:
1937         (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
1938         * rendering/updating/RenderTreeUpdater.cpp:
1939         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
1940         (WebCore::RenderTreeUpdater::updateAfterDescendants):
1941         (WebCore::RenderTreeUpdater::updateElementRenderer):
1942         (WebCore::elementImplicitVisibility):
1943         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
1944         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
1945         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
1946         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
1947         * style/InlineTextBoxStyle.cpp:
1948         (WebCore::visualOverflowForDecorations):
1949         * style/StyleChange.cpp:
1950         (WebCore::Style::determineChange):
1951         * style/StyleFontSizeFunctions.cpp:
1952         (WebCore::Style::computedFontSizeFromSpecifiedSize):
1953         * style/StyleResolveForDocument.cpp:
1954         (WebCore::Style::resolveForDocument):
1955         * style/StyleSharingResolver.cpp:
1956         * style/StyleTreeResolver.cpp:
1957         (WebCore::Style::affectsRenderedSubtree):
1958         (WebCore::Style::TreeResolver::resolveElement):
1959         (WebCore::Style::TreeResolver::resolvePseudoStyle):
1960         (WebCore::Style::TreeResolver::parentBoxStyle const):
1961         (WebCore::Style::createInheritedDisplayContentsStyleIfNeeded):
1962         (WebCore::Style::TreeResolver::resolveComposedTree):
1963         * svg/SVGElement.h:
1964         * svg/SVGGElement.cpp:
1965         (WebCore::SVGGElement::createElementRenderer):
1966
1967 2018-05-24  Chris Dumez  <cdumez@apple.com>
1968
1969         Enable subsampling for progressive JPEG images
1970         https://bugs.webkit.org/show_bug.cgi?id=185956
1971
1972         Reviewed by Said Abou-Hallawa.
1973
1974         Enable subsampling for progressive JPEG images now that it is supposed (rdar://problem/5191418).
1975         I verified locally that such images are still loading and do not cause any hang on iOS.
1976
1977         * platform/graphics/cg/ImageDecoderCG.cpp:
1978         (WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const):
1979
1980 2018-05-24  Chris Dumez  <cdumez@apple.com>
1981
1982         Reduce copying of FontCascadeDescription objects by moving them around
1983         https://bugs.webkit.org/show_bug.cgi?id=185963
1984
1985         Reviewed by Simon Fraser.
1986
1987         Reduce copying of FontCascadeDescription objects by moving them around when possible.
1988
1989         * css/StyleBuilderCustom.h:
1990         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
1991         (WebCore::StyleBuilderCustom::applyInitialFontFamily):
1992         (WebCore::StyleBuilderCustom::applyInheritFontFamily):
1993         (WebCore::StyleBuilderCustom::applyValueFontFamily):
1994         (WebCore::StyleBuilderCustom::applyInheritFontVariantLigatures):
1995         (WebCore::StyleBuilderCustom::applyInitialFontVariantLigatures):
1996         (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
1997         (WebCore::StyleBuilderCustom::applyInheritFontVariantNumeric):
1998         (WebCore::StyleBuilderCustom::applyInitialFontVariantNumeric):
1999         (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
2000         (WebCore::StyleBuilderCustom::applyInheritFontVariantEastAsian):
2001         (WebCore::StyleBuilderCustom::applyInitialFontVariantEastAsian):
2002         (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
2003         (WebCore::StyleBuilderCustom::applyInitialFontSize):
2004         (WebCore::StyleBuilderCustom::applyInheritFontSize):
2005         (WebCore::StyleBuilderCustom::applyInitialFontStyle):
2006         (WebCore::StyleBuilderCustom::applyInheritFontStyle):
2007         (WebCore::StyleBuilderCustom::applyValueFontStyle):
2008         (WebCore::StyleBuilderCustom::applyValueFontSize):
2009         * css/StyleResolver.cpp:
2010         (WebCore::checkForOrientationChange):
2011         (WebCore::StyleResolver::checkForTextSizeAdjust):
2012         (WebCore::StyleResolver::checkForZoomChange):
2013         (WebCore::StyleResolver::checkForGenericFamilyChange):
2014         (WebCore::StyleResolver::initializeFontStyle):
2015         * css/StyleResolver.h:
2016         (WebCore::StyleResolver::State::setFontDescription):
2017         (WebCore::StyleResolver::setFontDescription):
2018         * css/makeprop.pl:
2019         (generateInitialValueSetter):
2020         (generateInheritValueSetter):
2021         (generateValueSetter):
2022         * html/canvas/CanvasRenderingContext2D.cpp:
2023         (WebCore::CanvasRenderingContext2D::setFont):
2024         * page/DebugPageOverlays.cpp:
2025         (WebCore::NonFastScrollableRegionOverlay::drawRect):
2026         * page/linux/ResourceUsageOverlayLinux.cpp:
2027         * platform/graphics/FontCascade.cpp:
2028         (WebCore::FontCascade::FontCascade):
2029         * platform/graphics/FontCascade.h:
2030         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2031         (PlatformCALayerWin::drawTextAtPoint const):
2032         * platform/mock/MockRealtimeVideoSource.cpp:
2033         (WebCore::MockRealtimeVideoSource::drawText):
2034         * platform/win/DragImageWin.cpp:
2035         (WebCore::dragLabelFont):
2036         * platform/win/PopupMenuWin.cpp:
2037         (WebCore::PopupMenuWin::calculatePositionAndSize):
2038         (WebCore::PopupMenuWin::paint):
2039         * rendering/RenderBox.cpp:
2040         (WebCore::RenderBox::styleDidChange):
2041         * rendering/RenderCombineText.cpp:
2042         (WebCore::RenderCombineText::combineTextIfNeeded):
2043         * rendering/RenderEmbeddedObject.cpp:
2044         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
2045         * rendering/RenderListBox.cpp:
2046         (WebCore::bolder):
2047         (WebCore::RenderListBox::paintItemForeground):
2048         * rendering/RenderListItem.cpp:
2049         (WebCore::RenderListItem::computeMarkerStyle const):
2050         * rendering/RenderTheme.cpp:
2051         (WebCore::RenderTheme::adjustStyle):
2052         * rendering/RenderThemeMac.mm:
2053         (WebCore::RenderThemeMac::setFontFromControlSize const):
2054         * rendering/TextAutoSizing.cpp:
2055         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
2056         (WebCore::TextAutoSizingValue::reset):
2057         * rendering/style/RenderStyle.cpp:
2058         (WebCore::RenderStyle::setFontDescription):
2059         (WebCore::RenderStyle::setFontSize):
2060         (WebCore::RenderStyle::setFontVariationSettings):
2061         (WebCore::RenderStyle::setFontWeight):
2062         (WebCore::RenderStyle::setFontStretch):
2063         (WebCore::RenderStyle::setFontItalic):
2064         * rendering/style/RenderStyle.h:
2065         * rendering/svg/RenderSVGInlineText.cpp:
2066         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
2067         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2068         (WebCore::styleForFirstLetter):
2069         * style/StyleResolveForDocument.cpp:
2070         (WebCore::Style::resolveForDocument):
2071
2072 2018-05-24  Chris Dumez  <cdumez@apple.com>
2073
2074         Avoid constructing the string "all" repeatedly in MediaQueryParser
2075         https://bugs.webkit.org/show_bug.cgi?id=185961
2076
2077         Reviewed by Simon Fraser.
2078
2079         Avoid constructing the string "all" repeatedly in MediaQueryParser by:
2080         - Having MediaQueryData use an std::optional<String> instead of a String
2081         - Updating MediaQueryParser to use a static to store the default media type
2082           and use it when the MediaQueryData's media type is std::nullopt.
2083
2084         Also do some cleanup.
2085
2086         * css/parser/MediaQueryParser.cpp:
2087         (WebCore::MediaQueryParser::commitMediaQuery):
2088         (WebCore::MediaQueryParser::MediaQueryData::MediaQueryData):
2089         (WebCore::MediaQueryParser::MediaQueryData::clear):
2090         (WebCore::MediaQueryParser::MediaQueryData::addExpression):
2091         (WebCore::MediaQueryParser::MediaQueryData::lastExpressionValid):
2092         (WebCore::MediaQueryParser::MediaQueryData::removeLastExpression):
2093         * css/parser/MediaQueryParser.h:
2094         (WebCore::MediaQueryParser::MediaQueryData::setMediaType):
2095         (WebCore::MediaQueryParser::MediaQueryData::restrictor const):
2096         (WebCore::MediaQueryParser::MediaQueryData::expressions):
2097         (WebCore::MediaQueryParser::MediaQueryData::mediaType const):
2098         (WebCore::MediaQueryParser::MediaQueryData::currentMediaQueryChanged const):
2099         (WebCore::MediaQueryParser::MediaQueryData::restrictor):
2100         (WebCore::MediaQueryParser::MediaQueryData::setRestrictor):
2101         (WebCore::MediaQueryParser::MediaQueryData::setMediaFeature):
2102         (WebCore::MediaQueryParser::MediaQueryData::setMediaQueryParserContext):
2103
2104 2018-05-24  Joseph Pecoraro  <pecoraro@apple.com>
2105
2106         [iOS] Hard link AppSupport instead of soft linking
2107         https://bugs.webkit.org/show_bug.cgi?id=185959
2108         <rdar://problem/40506538>
2109
2110         Reviewed by Timothy Horton.
2111
2112         * Configurations/WebCore.xcconfig:
2113         * platform/network/ios/NetworkStateNotifierIOS.mm:
2114         (-[WebNetworkStateObserver initWithBlock:]):
2115         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
2116
2117 2018-05-24  Chris Dumez  <cdumez@apple.com>
2118
2119         Cache navigator.userAgent for performance
2120         https://bugs.webkit.org/show_bug.cgi?id=185952
2121
2122         Reviewed by Geoffrey Garen.
2123
2124         Cache navigator.userAgent for performance. Previously, we would ask the client 5 times
2125         while loading apple.com.
2126
2127         * page/Navigator.cpp:
2128         (WebCore::Navigator::userAgent const):
2129         * page/Navigator.h:
2130         * page/NavigatorBase.h:
2131         * page/NavigatorID.idl:
2132         * page/WorkerNavigator.cpp:
2133         (WebCore::WorkerNavigator::userAgent const):
2134         * page/WorkerNavigator.h:
2135
2136 2018-05-24  Chris Dumez  <cdumez@apple.com>
2137
2138         Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
2139         https://bugs.webkit.org/show_bug.cgi?id=185951
2140
2141         Reviewed by Geoffrey Garen.
2142
2143         Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
2144         launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
2145         should be enabled.
2146
2147         * platform/mac/LoggingMac.mm:
2148         (WebCore::logLevelString):
2149         * platform/unix/LoggingUnix.cpp:
2150         (WebCore::logLevelString):
2151         * platform/win/LoggingWin.cpp:
2152         (WebCore::logLevelString):
2153
2154 2018-05-24  Chris Dumez  <cdumez@apple.com>
2155
2156         [iOS WK2] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html is a flaky failure
2157         https://bugs.webkit.org/show_bug.cgi?id=181499
2158         <rdar://problem/36443428>
2159
2160         Reviewed by Youenn Fablet.
2161
2162         After resolving a registration promise, we send an IPC back to the StorageProcess
2163         for synchronization purposes, to make sure the registration does not get updated
2164         before the promise's JS code has been executed. However, resolving a promise
2165         schedules a microtask to run the JS and we would therefore send the IPC back too
2166         early, thus causing flakiness. We now only send the IPC back back only after that
2167         microtask has run and the JS has been executed.
2168
2169         * bindings/js/JSDOMPromiseDeferred.cpp:
2170         (WebCore::DeferredPromise::callFunction):
2171         (WebCore::DeferredPromise::whenSettled):
2172         * bindings/js/JSDOMPromiseDeferred.h:
2173         * workers/service/ServiceWorkerContainer.cpp:
2174         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2175
2176 2018-05-24  Jinho Bang  <zino@chromium.org>
2177
2178         [PaymentRequest] Remove currencySystem member
2179         https://bugs.webkit.org/show_bug.cgi?id=185860
2180
2181         Reviewed by Andy Estes.
2182
2183         After a long discussion, Web Payment Working Group decided to remove
2184         the `currencySystem` member[1]. The currency code should be well-formed
2185         3-letter alphabetic code and is allowed even if that is not part of
2186         the official ISO 4217 list.
2187
2188         [1] https://github.com/w3c/payment-request/pull/694
2189
2190         Test: http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html
2191
2192         * Modules/paymentrequest/PaymentCurrencyAmount.h:
2193         * Modules/paymentrequest/PaymentCurrencyAmount.idl:
2194         * Modules/paymentrequest/PaymentRequest.cpp:
2195         (WebCore::checkAndCanonicalizeAmount):
2196         (WebCore::checkAndCanonicalizeTotal):
2197         * inspector/WebInjectedScriptHost.cpp:
2198         (WebCore::objectForPaymentCurrencyAmount):
2199
2200 2018-05-24  Zalan Bujtas  <zalan@apple.com>
2201
2202         [LFC] Implement position computation for inflow positioned elements
2203         https://bugs.webkit.org/show_bug.cgi?id=185936
2204
2205         Reviewed by Antti Koivisto.
2206
2207         * layout/blockformatting/BlockFormattingContext.cpp:
2208         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
2209         * layout/blockformatting/BlockFormattingContext.h:
2210         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2211         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
2212
2213 2018-05-24  Zalan Bujtas  <zalan@apple.com>
2214
2215         [LFC] Implement FormattingContext::placeInFlowPositionedChildren
2216         https://bugs.webkit.org/show_bug.cgi?id=185934
2217
2218         Reviewed by Antti Koivisto.
2219
2220         * layout/FormattingContext.cpp:
2221         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
2222         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
2223         * layout/FormattingContext.h:
2224         * layout/blockformatting/BlockFormattingContext.cpp:
2225         (WebCore::Layout::BlockFormattingContext::layout const):
2226
2227 2018-05-23  Joseph Pecoraro  <pecoraro@apple.com>
2228
2229         Use ASCIILiteral with applicationBundleIsEqualTo in RuntimeApplicationChecksCocoa
2230         https://bugs.webkit.org/show_bug.cgi?id=185935
2231
2232         Reviewed by Yusuke Suzuki.
2233
2234         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2235         (WebCore::MacApplication::isSafari):
2236         (WebCore::MacApplication::isAppleMail):
2237         (WebCore::MacApplication::isIBooks):
2238         (WebCore::MacApplication::isITunes):
2239         (WebCore::MacApplication::isMicrosoftMessenger):
2240         (WebCore::MacApplication::isAdobeInstaller):
2241         (WebCore::MacApplication::isAOLInstantMessenger):
2242         (WebCore::MacApplication::isMicrosoftMyDay):
2243         (WebCore::MacApplication::isMicrosoftOutlook):
2244         (WebCore::MacApplication::isQuickenEssentials):
2245         (WebCore::MacApplication::isAperture):
2246         (WebCore::MacApplication::isVersions):
2247         (WebCore::MacApplication::isHRBlock):
2248         (WebCore::MacApplication::isIAdProducer):
2249         (WebCore::MacApplication::isSolidStateNetworksDownloader):
2250         (WebCore::IOSApplication::isMobileMail):
2251         (WebCore::IOSApplication::isMobileSafari):
2252         (WebCore::IOSApplication::isWebBookmarksD):
2253         (WebCore::IOSApplication::isDumpRenderTree):
2254         (WebCore::IOSApplication::isMobileStore):
2255         (WebCore::IOSApplication::isSpringBoard):
2256         (WebCore::IOSApplication::isWebApp):
2257         (WebCore::IOSApplication::isIBooks):
2258         (WebCore::IOSApplication::isIBooksStorytime):
2259         (WebCore::IOSApplication::isTheSecretSocietyHiddenMystery):
2260         (WebCore::IOSApplication::isCardiogram):
2261         (WebCore::IOSApplication::isNike):
2262
2263 2018-05-23  Brent Fulgham  <bfulgham@apple.com>
2264
2265         Avoid keeping FormState alive longer than necessary
2266         https://bugs.webkit.org/show_bug.cgi?id=185877
2267         <rdar://problem/39329219>
2268
2269         Reviewed by Ryosuke Niwa.
2270
2271         A number of crash fixes were done to prevent FormState objects from being
2272         accessed after their relevant Frames had been destroyed. Unfortunately, this
2273         could cause the FormState to persist after the owning Frame had been
2274         destroyed, resulting in nullptr dereferences.
2275
2276         This patch does the following:
2277
2278         1. Uses WeakPtr's for FormState objects passed to completion handlers, rather
2279            than RefPtr, since those completion handlers might fire as part of the
2280            clean-up process during Frame destruction. This allows us to use the FormState
2281            if they are still valid, but gracefully handle cases where a form submission
2282            is cancelled in-flight.
2283         2. Moves FormState object as they pass through the loader.
2284         3. Removes some extraneous WTFMove() calls being made on bare FormState pointers.
2285         4. Changes FormSubmission to hold a RefPtr so we can move the FormState to the
2286            loader in the code path that uses it (the FormSubmission is always destroyed
2287            shortly afterwards).
2288         5. Changes the trap from Bug 183704 so that it only fires if the FormState object
2289            is being retained more than once.
2290
2291         * loader/DocumentLoader.cpp:
2292         (WebCore::DocumentLoader::willSendRequest): Update for new CompletionHandler
2293         signature.
2294         * loader/FormState.cpp:
2295         (WebCore::FormState::willDetachPage): Revise trap to check for retain counts
2296         above one.
2297         * loader/FormState.h:
2298         (WebCore::FormState::weakPtrFactory const): Added.
2299         * loader/FormSubmission.h:
2300         (WebCore::FormSubmission::state const): Revised for change to RefPtr.
2301         (WebCore::FormSubmission::takeState): Added.
2302         * loader/FrameLoader.cpp:
2303         (WebCore::FrameLoader::urlSelected): Update for new CompletionHandler signature.
2304         (WebCore::FrameLoader::loadURLIntoChildFrame): Ditto.
2305         (WebCore::FrameLoader::loadFrameRequest): Ditto.
2306         (WebCore::FrameLoader::loadURL): Ditto.
2307         (WebCore::FrameLoader::load): Ditto.
2308         (WebCore::FrameLoader::loadWithNavigationAction): Ditto.
2309         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
2310         (WebCore::FrameLoader::reloadWithOverrideEncoding): Ditto.
2311         (WebCore::FrameLoader::reload): Ditto.
2312         (WebCore::FrameLoader::loadPostRequest): Ditto.
2313         (WebCore::FrameLoader::loadDifferentDocumentItem): Ditto.
2314         * loader/FrameLoader.h:
2315         * loader/NavigationScheduler.cpp:
2316         * loader/PolicyChecker.cpp:
2317         (WebCore::PolicyChecker::checkNavigationPolicy):Revise to use WeakPtr for
2318         FormState passed to the completion handler. Remove some extraneous WTFMove()
2319         calls on bare pointers.
2320         (WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.
2321         * loader/PolicyChecker.h:
2322         * page/ContextMenuController.cpp:
2323         (WebCore::openNewWindow): Revise for new signatures.
2324         (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
2325
2326 2018-05-23  Keith Miller  <keith_miller@apple.com>
2327
2328         Expose $vm if window.internals is exposed
2329         https://bugs.webkit.org/show_bug.cgi?id=185900
2330
2331         Reviewed by Mark Lam.
2332
2333         This is useful for testing vm internals when running LayoutTests.
2334
2335         * testing/js/WebCoreTestSupport.cpp:
2336         (WebCoreTestSupport::injectInternalsObject):
2337
2338 2018-05-23  David Kilzer  <ddkilzer@apple.com>
2339
2340         Don't create the SubimageCache just to clear an image from it
2341         <https://webkit.org/b/185757>
2342
2343         Reviewed by Said Abou-Hallawa.
2344
2345         To fix this we make SubimageCacheWithTimer::clearImage() a
2346         static class method that checks whether the cache exists before
2347         removing it.  We also make SubimageCacheWithTimer::getImage() a
2348         static class method, and move more methods into the
2349         SubimageCacheWithTimer class and make them private to reduce API
2350         footprint.
2351
2352         * platform/graphics/cg/GraphicsContextCG.cpp:
2353         (WebCore::GraphicsContext::drawNativeImage): Switch to use new
2354         SubimageCacheWithTimer::getSubimage() static class method.
2355         * platform/graphics/cg/NativeImageCG.cpp:
2356         (WebCore::clearNativeImageSubimages): Switch to use new
2357         SubimageCacheWithTimer::clearImage() static class method which
2358         returns early if the subimage cache has not been created yet.
2359         This fixes the bug.
2360
2361         * platform/graphics/cg/SubimageCacheWithTimer.cpp:
2362         (WebCore::SubimageCacheWithTimer::s_cache): Allocate space for
2363         static class variable.
2364         (WebCore::SubimageCacheWithTimer::getSubimage): Replace instance
2365         method with new static class method that gets the subimage cache
2366         singleton and calls the subimage() instance method.
2367         (WebCore::SubimageCacheWithTimer::clearImage): Replace instance
2368         methdod with new static class method that returns early if the
2369         static cache singleton doesn't exist (fixes the bug), otherwise
2370         calls the clearImageAndSubimages() instance method.
2371         (WebCore::SubimageCacheWithTimer::subimage): Rename from
2372         getSubimage().  Use `auto` after renaming SubimageCache typedef
2373         to SubimageCacheHashSet.
2374         (WebCore::SubimageCacheWithTimer::clearImageAndSubimages):
2375         Rename from clearImage().  Modernize loops.
2376         (WebCore::SubimageCacheWithTimer::subimageCache): Change
2377         WebCore::subimageCache() to a static class method that creates
2378         the subimage cache singleton if it doesn't exist yet, and
2379         returns it.
2380         (WebCore::SubimageCacheWithTimer::subimageCacheExists): Add.
2381         Returns false if the subimage cache singleton has not been
2382         created yet.
2383
2384         * platform/graphics/cg/SubimageCacheWithTimer.h:
2385         - Rename typedef SubimageCache to SubimageCacheHashSet to avoid
2386           general confusion.
2387         (WebCore::SubimageCacheWithTimer::getSubimage):
2388         (WebCore::SubimageCacheWithTimer::clearImage):
2389         - Change to static class methods.
2390         (WebCore::SubimageCacheWithTimer::SubimageCacheWithTimer):
2391         - Make private.
2392         (WebCore::SubimageCacheWithTimer::subimage):
2393         - Rename from getSubimage() and make private.
2394         (WebCore::SubimageCacheWithTimer::clearImageAndSubimages):
2395         - Rename from clearImage() and make private.
2396         (WebCore::SubimageCacheWithTimer::subimageCache):
2397         - Rename from WebCore::subimageCache() and make a private static
2398           class method.
2399         (WebCore::SubimageCacheWithTimer::subimageCacheExists):
2400         - Add private static class method.
2401         (WebCore::SubimageCacheWithTimer::s_cache):
2402         - Declare private static variable to hold singleton.
2403
2404 2018-05-23  Eric Carlson  <eric.carlson@apple.com>
2405
2406         Avoid loading AVFoundation to check supported MIME types if possible
2407         https://bugs.webkit.org/show_bug.cgi?id=185839
2408         <rdar://problem/40182010>
2409
2410         Reviewed by Jer Noble.
2411
2412         Avoid loading AVFoundation to call +[AVURLAssetClass audiovisualMIMETypes] as long as possible,
2413         and when they are loaded send the list to the UI process so it can pass it to all extant
2414         and all new web processes so they can won't have call it at all.
2415
2416         * WebCore.xcodeproj/project.pbxproj:
2417         * platform/graphics/ImageDecoder.cpp:
2418         (WebCore::ImageDecoder::create): Don't call ImageDecoderAVFObjC::canDecodeType if 
2419         ImageDecoderCG can decode the type so we don't have to load AVFoundation.
2420         (WebCore::ImageDecoder::supportsMediaType): Return as soon as a decoder class says
2421         it supports a media type to avoid calling more than one. Call ImageDecoderAVFObjC last.
2422
2423         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h:
2424         (WebCore::AVFoundationMIMETypeCache::setCacheMIMETypesCallback):
2425         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
2426         (WebCore::AVFoundationMIMETypeCache::singleton): Simplify.
2427         (WebCore::AVFoundationMIMETypeCache::setSupportedTypes): Cache the supplied list of types
2428         so we won't have to load AVFoundation when asked for types later.
2429         (WebCore::AVFoundationMIMETypeCache::types):
2430         (WebCore::AVFoundationMIMETypeCache::supportsContentType): New convenience routine.
2431         (WebCore::AVFoundationMIMETypeCache::canDecodeType): Ditto.
2432         (WebCore::AVFoundationMIMETypeCache::isAvailable const): New, check to see if AVFoundation.framework
2433         is available without actually loading it.
2434         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes): Load types if possible.
2435         (WebCore::AVFoundationMIMETypeCache::AVFoundationMIMETypeCache): Deleted.
2436         (WebCore::AVFoundationMIMETypeCache::loadTypes): Deleted.
2437
2438         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2439         (WebCore::ImageDecoderAVFObjC::create): Use AVFoundationMIMETypeCache::isAvailable instead
2440         of loading the frameworks.
2441         (WebCore::ImageDecoderAVFObjC::supportsMediaType): Ditto.
2442         (WebCore::ImageDecoderAVFObjC::supportsContentType): Use AVFoundationMIMETypeCache::supportsContentType.
2443         (WebCore::ImageDecoderAVFObjC::canDecodeType): Use AVFoundationMIMETypeCache::canDecodeType.
2444
2445         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2446         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): ASSERT if the 
2447         AVFoundationMIMETypeCache is empty, it shouldn't be possible to get here in that state.
2448         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Use AVFoundationMIMETypeCache::supportsContentType.
2449         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Use AVFoundationMIMETypeCache::canDecodeType.
2450
2451         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2452         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): ASSERT if the 
2453         AVFoundationMIMETypeCache is empty, it shouldn't be possible to get here in that state.
2454         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Use AVFoundationMIMETypeCache::canDecodeType.
2455
2456         * platform/graphics/cg/ImageDecoderCG.cpp:
2457         (WebCore::ImageDecoderCG::canDecodeType): New.
2458         * platform/graphics/cg/ImageDecoderCG.h:
2459
2460 2018-05-23  Chris Dumez  <cdumez@apple.com>
2461
2462         RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its cross-origin parent
2463         https://bugs.webkit.org/show_bug.cgi?id=185664
2464         <rdar://problem/36185260>
2465
2466         Reviewed by Simon Fraser.
2467
2468         RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its
2469         cross-origin parent. There was logic in FrameLoader::scrollToFragmentWithParentBoundary()
2470         to temporarily set the 'safeToPropagateScrollToParent' flag to false on the cross-origin
2471         ancestor frame during the call to FrameView::scrollToFragment(). This would correctly
2472         prevent RenderLayer::scrollRectToVisible() to propagate the scroll to the cross-origin
2473         ancestor frame when scrollRectToVisible() is called synchronously. However,
2474         scrollRectToVisible() can get called asynchronously in case of a dirty layout, as part
2475         of the post layout tasks.
2476
2477         To address the issue, we get rid of the safeToPropagateScrollToParent flag on FrameView
2478         and instead update FrameView::safeToPropagateScrollToParent() to do the cross-origin
2479         check. FrameView::safeToPropagateScrollToParent() is called by RenderLayer::scrollRectToVisible()
2480         and this is a lot more robust than relying on a flag which gets temporarily set.
2481
2482         Test: http/tests/navigation/fragment-navigation-cross-origin-subframe-no-scrolling-parent.html
2483
2484         * dom/Document.cpp:
2485         * dom/Document.h:
2486         * loader/FrameLoader.cpp:
2487         (WebCore::FrameLoader::scrollToFragmentWithParentBoundary):
2488         * page/FrameView.cpp:
2489         (WebCore::FrameView::FrameView):
2490         (WebCore::FrameView::reset):
2491         (WebCore::FrameView::safeToPropagateScrollToParent const):
2492         * page/FrameView.h:
2493
2494 2018-05-23  Youenn Fablet  <youenn@apple.com>
2495
2496         NetworkLoadChecker should check cached redirections
2497         https://bugs.webkit.org/show_bug.cgi?id=185849
2498
2499         Reviewed by Chris Dumez.
2500
2501         Covered by rebased tests.
2502
2503         * loader/SubresourceLoader.cpp:
2504         (WebCore::SubresourceLoader::willSendRequestInternal):
2505        Log the case of a redirection with fetch error mode.
2506
2507 2018-05-23  Nan Wang  <n_wang@apple.com>
2508
2509         AX: setValue on contenteditable should preserve whitespace
2510         https://bugs.webkit.org/show_bug.cgi?id=185897
2511
2512         Reviewed by Chris Fleizach.
2513
2514         RenderText is using its parent renderer's style to determine if
2515         whitespace collapsing is necessary. So when setting the innerText
2516         of the element in setValue, let's also set its style in order to 
2517         preserve whitespaces.
2518
2519         Modified an existing test to cover this change.
2520
2521         * accessibility/AccessibilityRenderObject.cpp:
2522         (WebCore::AccessibilityRenderObject::setValue):
2523
2524 2018-05-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2525
2526         [GTK] Silence GCC 8 warnings
2527         https://bugs.webkit.org/show_bug.cgi?id=185556
2528
2529         Reviewed by Žan Doberšek.
2530
2531         Silence remaining -Wcast-function-type warnings by casting through void (*)(void), aka
2532         GCallback.
2533
2534         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2535         (webkitAccessibleHyperlinkSetProperty):
2536         (webkitAccessibleHyperlinkGetType):
2537         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2538         (webkitAccessibleGetType):
2539         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2540         (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
2541
2542 2018-05-23  Zalan Bujtas  <zalan@apple.com>
2543
2544         [LFC] Move sizing/positioning logic to helper classes
2545         https://bugs.webkit.org/show_bug.cgi?id=185898
2546
2547         Reviewed by Antti Koivisto.
2548
2549         The idea here is to move all the sizing and positioning logic to helper classes so that
2550         the formatting context code stays lean.
2551         This is similar to the dedicated BlockMarginCollapse class for the collapsing logic.
2552         The helper classes have only static functions. These static functions do not mutate the associated DisplayBoxes,
2553         but instead they simply retun the computed values.
2554
2555         * Sources.txt:
2556         * WebCore.xcodeproj/project.pbxproj:
2557         * layout/FormattingContext.cpp:
2558         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
2559         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
2560         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
2561         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
2562         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
2563         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const): Deleted.
2564         (WebCore::Layout::FormattingContext::computeFloatingNonReplacedHeight const): Deleted.
2565         (WebCore::Layout::FormattingContext::computeReplacedHeight const): Deleted.
2566         (WebCore::Layout::FormattingContext::computeReplacedWidth const): Deleted.
2567         (WebCore::Layout::FormattingContext::contentHeightForFormattingContextRoot const): Deleted.
2568         (WebCore::Layout::FormattingContext::computeFloatingNonReplacedWidth const): Deleted.
2569         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const): Deleted.
2570         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedHeight const): Deleted.
2571         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedWidth const): Deleted.
2572         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedPosition const): Deleted.
2573         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const): Deleted.
2574         (WebCore::Layout::FormattingContext::shrinkToFitWidth const): Deleted.
2575         * layout/FormattingContext.h:
2576         * layout/FormattingContextGeometry.cpp: Copied from Source/WebCore/layout/FormattingContext.cpp.
2577         (WebCore::Layout::contentHeightForFormattingContextRoot):
2578         (WebCore::Layout::shrinkToFitWidth):
2579         (WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedHeight):
2580         (WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedWidth):
2581         (WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedHeight):
2582         (WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedWidth):
2583         (WebCore::Layout::FormattingContextGeometry::floatingNonReplacedHeight):
2584         (WebCore::Layout::FormattingContextGeometry::floatingNonReplacedWidth):
2585         (WebCore::Layout::FormattingContextGeometry::floatingReplacedHeight):
2586         (WebCore::Layout::FormattingContextGeometry::floatingReplacedWidth):
2587         (WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedPosition):
2588         (WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedPosition):
2589         (WebCore::Layout::FormattingContextGeometry::replacedHeight):
2590         (WebCore::Layout::FormattingContextGeometry::replacedWidth):
2591         * layout/FormattingContextGeometry.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingContext.h.
2592         * layout/blockformatting/BlockFormattingContext.cpp:
2593         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2594         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
2595         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
2596         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedWidth const): Deleted.
2597         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const): Deleted.
2598         * layout/blockformatting/BlockFormattingContext.h:
2599         * layout/blockformatting/BlockFormattingContextGeometry.cpp: Added.
2600         (WebCore::Layout::BlockFormattingContextGeometry::inFlowNonReplacedHeight):
2601         (WebCore::Layout::BlockFormattingContextGeometry::inFlowNonReplacedWidth):
2602         (WebCore::Layout::BlockFormattingContextGeometry::inFlowReplacedHeight):
2603         (WebCore::Layout::BlockFormattingContextGeometry::inFlowReplacedWidth):
2604         (WebCore::Layout::BlockFormattingContextGeometry::staticPosition):
2605         * layout/blockformatting/BlockFormattingContextGeometry.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingContext.h.
2606         * layout/displaytree/DisplayBox.h:
2607
2608 2018-05-23  Antti Koivisto  <antti@apple.com>
2609
2610         Page keeps reloading when viewing photos in google drive (due to too high canvas memory limits)
2611         https://bugs.webkit.org/show_bug.cgi?id=185903
2612         <rdar://problem/38420562>
2613
2614         Reviewed by Simon Fraser.
2615
2616         The canvas memory usage limits don't work on iOS since the current 2GB minimum limit is
2617         larger than the maximum process size.
2618
2619         * html/HTMLCanvasElement.cpp:
2620         (WebCore::maxActivePixelMemory):
2621
2622         Always base this on the reported ramSize() on iOS. Make it still fairly large to not risk breaking
2623         any currently working content. In practice the limit computes to 448MB on device at the moment.
2624
2625 2018-05-23  Zalan Bujtas  <zalan@apple.com>
2626
2627         [LFC] Implement positioning for replaced out-of-flow elements
2628         https://bugs.webkit.org/show_bug.cgi?id=185902
2629
2630         Reviewed by Antti Koivisto.
2631
2632         * layout/FormattingContext.cpp:
2633         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const):
2634
2635 2018-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
2636
2637         Text can wrap between hyphens and commas
2638         https://bugs.webkit.org/show_bug.cgi?id=185899
2639         <rdar://problem/40118983>
2640
2641         Reviewed by Zalan Bujtas.
2642
2643         Chrome, Firefox, and ICU all agree that text shouldn't wrap there.
2644
2645         Test: fast/text/line-break-hyphen-comma.html
2646
2647         * rendering/BreakLines.cpp:
2648
2649 2018-05-22  Simon Fraser  <simon.fraser@apple.com>
2650
2651         Add notifyutil callbacks to dump the memory cache, and the list of live Pages and Documents
2652         https://bugs.webkit.org/show_bug.cgi?id=185853
2653
2654         Reviewed by Keith Miller.
2655
2656         Add a notifyutil callback to dump the PageCache, which dumps the stats, and the list of live pages.
2657         This can be invoked on iOS and macOS via "notifyutil -p com.apple.WebKit.showPageCache".
2658         
2659         Add a notifyutil callback that dumps the list of all Pages, and the list of all Documents, with
2660         Document pointer address and URL.
2661         This can be invoked on iOS and macOS via "notifyutil -p com.apple.WebKit.showAllDocuments".
2662
2663         * history/PageCache.cpp:
2664         (WebCore::PageCache::PageCache):
2665         (WebCore::PageCache::dump const):
2666         * history/PageCache.h:
2667         * loader/cache/CachedResource.h:
2668         (WebCore::CachedResource::numberOfClients const):
2669         (WebCore::CachedResource::count const): Deleted.
2670         * loader/cache/MemoryCache.cpp:
2671         (WebCore::MemoryCache::MemoryCache):
2672         (WebCore::MemoryCache::pruneLiveResourcesToSize):
2673         (WebCore::MemoryCache::dumpStats):
2674         (WebCore::MemoryCache::dumpLRULists const):
2675         * loader/cache/MemoryCache.h:
2676         * page/mac/PageMac.mm:
2677         (WebCore::Page::platformInitialize):
2678
2679 2018-05-22  Dean Jackson  <dino@apple.com>
2680
2681         Optimized path zoom animation needs a valid UIImage and CGRect
2682         https://bugs.webkit.org/show_bug.cgi?id=185883
2683         <rdar://problem/40306056>
2684
2685         Build fix.
2686
2687         * loader/FrameLoadRequest.h:
2688
2689 2018-05-22  Commit Queue  <commit-queue@webkit.org>
2690
2691         Unreviewed, rolling out r232081.
2692         https://bugs.webkit.org/show_bug.cgi?id=185895
2693
2694         Broke two API tests (Requested by bfulgham_ on #webkit).
2695
2696         Reverted changeset:
2697
2698         "Avoid keeping FormState alive longer than necessary"
2699         https://bugs.webkit.org/show_bug.cgi?id=185877
2700         https://trac.webkit.org/changeset/232081
2701
2702 2018-05-22  Dean Jackson  <dino@apple.com>
2703
2704         Optimized path zoom animation needs a valid UIImage and CGRect
2705         https://bugs.webkit.org/show_bug.cgi?id=185883
2706         <rdar://problem/40306056>
2707
2708         Reviewed by Jon Lee.
2709
2710         Pass the bounding box of the element that was clicked onto
2711         the UI process, so it can perform an animation from that spot.
2712
2713         This involved adding an IntRect to the ResourceRequest, and passing
2714         that info into it from the HTMLAnchorElement, using a new struct
2715         called SystemPreviewInfo.
2716
2717         * html/HTMLAnchorElement.cpp:
2718         (WebCore::HTMLAnchorElement::handleClick):
2719         * loader/FrameLoadRequest.cpp:
2720         (WebCore::FrameLoadRequest::FrameLoadRequest):
2721         * loader/FrameLoadRequest.h:
2722         (WebCore::FrameLoadRequest::FrameLoadRequest):
2723         (WebCore::FrameLoadRequest::isSystemPreview const):
2724         (WebCore::FrameLoadRequest::systemPreviewRect const):
2725         * loader/FrameLoader.cpp:
2726         (WebCore::FrameLoader::urlSelected):
2727         (WebCore::FrameLoader::loadURL):
2728         * loader/FrameLoader.h:
2729         (WebCore::FrameLoader::urlSelected):
2730         * loader/FrameLoaderTypes.h:
2731         * platform/network/ResourceRequestBase.cpp:
2732         (WebCore::ResourceRequestBase::systemPreviewRect const):
2733         (WebCore::ResourceRequestBase::setSystemPreviewRect):
2734         * platform/network/ResourceRequestBase.h:
2735
2736 2018-05-22  Chris Dumez  <cdumez@apple.com>
2737
2738         [POSIX] Use access() instead of stat() in FileSystem::fileExists()
2739         https://bugs.webkit.org/show_bug.cgi?id=185882
2740
2741         Reviewed by Geoffrey Garen.
2742
2743         Use access() instead of stat() in FileSystem::fileExists(). stat() returns a lot of information we
2744         do not leverage and local benchmarking on macOS shows access() being > 80% faster than stat():
2745         stat: 0.31567 (lower is better)
2746         access: 0.16074 (lower is better)
2747         stat: 0.303665 (lower is better)
2748         access: 0.165468 (lower is better)
2749
2750         * platform/posix/FileSystemPOSIX.cpp:
2751         (WebCore::FileSystem::fileExists):
2752
2753 2018-05-22  Brent Fulgham  <bfulgham@apple.com>
2754
2755         Avoid keeping FormState alive longer than necessary
2756         https://bugs.webkit.org/show_bug.cgi?id=185877
2757         <rdar://problem/39329219>
2758
2759         Reviewed by Ryosuke Niwa.
2760
2761         A number of crash fixes were done to prevent FormState objects from being
2762         accessed after their relevant Frames had been destroyed. Unfortunately, this
2763         could cause the FormState to persist after the owning Frame had been
2764         destroyed, resulting in nullptr dereferences.
2765
2766         This patch does the following:
2767
2768         1. Changes to use WeakPtr's for FormState objects passed to completion handlers,
2769            rather than RefPtr, since those completion handlers might fire as part of
2770            the clean-up process during Frame destruction. This allows us to use the FormState
2771            if they are still valid, but gracefully handle cases where a form submission
2772            is cancelled in-flight.
2773         2. Removes some extraneous WTFMove() calls being made on bare FormState pointers.
2774         3. Changes the trap from Bug 183704 so that it only fires if the FormState object
2775            is being retained more than once.
2776
2777         * loader/DocumentLoader.cpp:
2778         (WebCore::DocumentLoader::willSendRequest): Update for new CompletionHandler
2779         signature.
2780         * loader/FormState.cpp:
2781         (WebCore::FormState::willDetachPage): Revise trap to check for retain counts
2782         above one.
2783         * loader/FormState.h:
2784         (WebCore::FormState::weakPtrFactory const): Added.
2785         * loader/FrameLoader.cpp:
2786         (WebCore::FrameLoader::loadFrameRequest): Revise to use WeakPtr for FormState
2787         passed to the completion handler.
2788         (WebCore::FrameLoader::loadURL): Update for new CompletionHandler signature.
2789         (WebCore::FrameLoader::load): Ditto.
2790         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
2791         (WebCore::FrameLoader::loadPostRequest): Ditto.
2792         * loader/PolicyChecker.cpp:
2793         (WebCore::PolicyChecker::checkNavigationPolicy): Revise to use WeakPtr for
2794         FormState passed to the completion handler. Remove some extraneous WTFMove()
2795         calls on bare pointers.
2796         (WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.
2797         * loader/PolicyChecker.h:
2798
2799 2018-05-22  Sihui Liu  <sihui_liu@apple.com>
2800
2801         Conversion between SecurityOriginData and DatabaseIdentifier is asymmetric when port is null
2802         https://bugs.webkit.org/show_bug.cgi?id=185715
2803
2804         Reviewed by Geoffrey Garen.
2805
2806         Fixed the issue of null port when converting between SecurityOriginData and DatabaseIdentifier.
2807
2808         Test: WKWebView.LocalStorageFetchDataRecords.
2809
2810         * page/SecurityOriginData.cpp:
2811         (WebCore::SecurityOriginData::fromDatabaseIdentifier):
2812
2813 2018-05-22  Keith Miller  <keith_miller@apple.com>
2814
2815         We should have a CoW storage for NewArrayBuffer arrays.
2816         https://bugs.webkit.org/show_bug.cgi?id=185003
2817
2818         Reviewed by Filip Pizlo.
2819
2820         * bindings/js/JSDOMConvertSequences.h:
2821         (WebCore::Detail::NumericSequenceConverter::convertArray):
2822         (WebCore::Detail::SequenceConverter::convertArray):
2823
2824 2018-05-22  Ryan Haddad  <ryanhaddad@apple.com>
2825
2826         Unreviewed, rolling out r232052.
2827
2828         Breaks internal builds.
2829
2830         Reverted changeset:
2831
2832         "Use more C++17"
2833         https://bugs.webkit.org/show_bug.cgi?id=185176
2834         https://trac.webkit.org/changeset/232052
2835
2836 2018-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2837
2838         [GTK] WebDriver: Network process crash when running imported/w3c/webdriver/tests/delete_cookie/delete.py::test_unknown_cookie
2839         https://bugs.webkit.org/show_bug.cgi?id=185867
2840
2841         Reviewed by Michael Catanzaro.
2842
2843         We need to null check the value returned by URL::createSoupURI() before passing it to soup.
2844
2845         * platform/network/soup/CookieJarSoup.cpp:
2846         (WebCore::setCookiesFromDOM):
2847         (WebCore::cookiesForSession):
2848         (WebCore::getRawCookies):
2849         (WebCore::deleteCookie):
2850         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2851         (WebCore::NetworkStorageSession::getCookies):
2852
2853 2018-05-22  Zalan Bujtas  <zalan@apple.com>
2854
2855         [LFC] Implement positioning for non-replaced out-of-flow elements.
2856         https://bugs.webkit.org/show_bug.cgi?id=185858
2857
2858         Reviewed by Antti Koivisto.
2859
2860         In certain cases, the out-of-flow element's final position depends on the element's size.
2861         Call computeOutOfFlowPosition() after width/height are resolved.
2862
2863         * layout/FormattingContext.cpp:
2864         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
2865         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2866         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedPosition const):
2867         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const):
2868         * layout/FormattingContext.h:
2869
2870 2018-05-22  Olivier Blin  <olivier.blin@softathome.com>
2871
2872         Fix build without MathML
2873         https://bugs.webkit.org/show_bug.cgi?id=185865
2874
2875         Reviewed by Frédéric Wang.
2876
2877         Regression(r226654): [RenderTreeBuilder] Move MathML addChild logic to RenderTreeBuilder
2878         https://bugs.webkit.org/show_bug.cgi?id=181443
2879
2880         Regression(r229694): Put the DOM in IsoHeaps
2881         https://bugs.webkit.org/show_bug.cgi?id=183546
2882
2883         No new tests, build fix.
2884
2885         * mathml/MathMLUnknownElement.cpp:
2886         * mathml/MathMLUnknownElement.h:
2887         * rendering/updating/RenderTreeBuilder.cpp:
2888         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
2889         (WebCore::RenderTreeBuilder::attach):
2890         * rendering/updating/RenderTreeBuilder.h:
2891         * rendering/updating/RenderTreeBuilderMathML.cpp:
2892         * rendering/updating/RenderTreeBuilderMathML.h:
2893
2894 2018-05-22  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2895
2896         [GStreamer] Don't set the ReadyState to HaveNothing when an error occurs in playback pipeline
2897         https://bugs.webkit.org/show_bug.cgi?id=185725
2898
2899         Reviewed by Philippe Normand.
2900
2901         The ReadyState should not be set to HaveNothing when an error occurs in playback pipeline, because
2902         at least we should have the metadata in order to have an error in pipeline.
2903
2904         Here is the definition of HaveNothing state in W3C spec https://dev.w3.org/html5/spec-preview/media-elements.html#ready-states
2905         "HAVE_NOTHING (numeric value 0): No information regarding the media resource is available. No data for the current
2906         playback position is available. Media elements whose networkState attribute is NETWORK_EMPTY are always in the HAVE_NOTHING state."
2907
2908         In MSE case, this patch fixes the crashes of the followings WPT encrypted-media tests:
2909         - clearkey-mp4-playback-temporary-clear-encrypted.https.html
2910         - clearkey-mp4-playback-temporary-multikey-sequential.https.html
2911         - clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html
2912
2913         Here is the cause of the crashes: When an error occurs in playback pipeline like no decipher key, in case of encrypted content,
2914         the MediaPlayerPrivateGstreamer sets NetworkState to FormatError which causes the detachment of MediaElement from MediaSource,
2915         then MediaPlayerPrivateGstreamer sets the ReadyState to HaveNothing which causes a trying again to play the same URI,
2916         thus the crash occurs because the MediaElement is detached from MediaSource, see bugzilla for more details.
2917         Note: these crashes should be fixed in 185242 but unfortunately it isn't the case. See bug 185242 for more details.
2918
2919         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2920         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2921
2922 2018-05-22  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2923
2924         [MSE][GStreamer] Fix the deadlock caused by bug 185242 (r231351)
2925         https://bugs.webkit.org/show_bug.cgi?id=185723
2926
2927         Reviewed by Xabier Rodriguez-Calvar.
2928
2929         After a detailed investigation, we found that, the patch r231351 doesn't fix the crash that expected to fix,
2930         it just replaces it by a deadlock. Now the crash is fixed in the bug 185725.
2931
2932         This Patch will remove a part of r231351 that causes the deadlock.
2933
2934         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2935         (webKitMediaSrcFreeStream):
2936
2937 2018-05-21  Yusuke Suzuki  <utatane.tea@gmail.com>
2938
2939         Use more C++17
2940         https://bugs.webkit.org/show_bug.cgi?id=185176
2941
2942         Reviewed by JF Bastien.
2943
2944         * Configurations/Base.xcconfig:
2945         * DerivedSources.make:
2946         * platform/ios/LegacyTileGrid.mm:
2947         (WebCore::LegacyTileGrid::dropDistantTiles):
2948
2949 2018-05-21  Zalan Bujtas  <zalan@apple.com>
2950
2951         [LFC] Box::isDescendantOf() should work with out-of-flow elements.
2952         https://bugs.webkit.org/show_bug.cgi?id=185812
2953
2954         Reviewed by Antti Koivisto.
2955
2956         Use the containing block chain instead of the parent chain to check for isDescendantOf().
2957         (containing block is not always the direct parent)
2958
2959         * layout/layouttree/LayoutBox.cpp:
2960         (WebCore::Layout::Box::isDescendantOf const):
2961
2962 2018-05-21  Chris Nardi  <cnardi@chromium.org>
2963
2964         Remove dead exception in MediaList.appendMedium
2965         https://bugs.webkit.org/show_bug.cgi?id=185278
2966
2967         Reviewed by Chris Dumez.
2968
2969         MediaList.appendMedium was able to throw an exception, but MediaQuerySet::add() always
2970         returned true, making it impossible for that exception to be thrown. This matched the
2971         spec, as |appendMedium| is not specified to throw an exception. Remove the dead code
2972         surrounding the exception, and make MediaQuerySet::add() return false if the medium is
2973         not added.
2974
2975         No new/modified tests as there should be no functional changes.
2976
2977         * css/MediaList.cpp:
2978         (WebCore::MediaQuerySet::add):
2979         (WebCore::MediaList::appendMedium):
2980         * css/MediaList.h:
2981         * css/MediaList.idl:
2982
2983 2018-05-21  Chris Dumez  <cdumez@apple.com>
2984
2985         File's structured serialization should serialize lastModified attribute
2986         https://bugs.webkit.org/show_bug.cgi?id=185773
2987
2988         Reviewed by Youenn Fablet.
2989
2990         Update our implementation for the stuctured serialization of a File to include
2991         its lastModified attribute, as per:
2992         - https://w3c.github.io/FileAPI/#file-section
2993
2994         No new tests, rebaselined existing test.
2995
2996         * bindings/js/SerializedScriptValue.cpp:
2997         (WebCore::CloneSerializer::write):
2998         (WebCore::CloneDeserializer::readFile):
2999         * fileapi/File.cpp:
3000         (WebCore::File::File):
3001         * fileapi/File.h:
3002
3003 2018-05-21  Zalan Bujtas  <zalan@apple.com>
3004
3005         [LFC] Add FormattingContext::validateGeometryConstraintsAfterLayout
3006         https://bugs.webkit.org/show_bug.cgi?id=185811
3007
3008         Reviewed by Antti Koivisto.
3009
3010         Also implement LayoutDescendantIterator and fix LayoutIterator.
3011
3012         * WebCore.xcodeproj/project.pbxproj:
3013         * layout/FormattingContext.cpp:
3014         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3015         * layout/FormattingContext.h:
3016         * layout/blockformatting/BlockFormattingContext.cpp:
3017         (WebCore::Layout::BlockFormattingContext::layout const):
3018         * layout/layouttree/LayoutDescendantIterator.h: Added.
3019         (WebCore::Layout::LayoutDescendantIterator<T>::LayoutDescendantIterator):
3020         (WebCore::Layout::LayoutDescendantIterator<T>::operator):
3021         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::LayoutDescendantIteratorAdapter):
3022         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::begin):
3023         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::end):
3024         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::at):
3025         (WebCore::Layout::descendantsOfType):
3026         * layout/layouttree/LayoutIterator.h:
3027         (WebCore::Layout::LayoutBoxTraversal::firstChild):
3028         (WebCore::Layout::LayoutBoxTraversal::nextAncestorSibling):
3029         (WebCore::Layout::LayoutBoxTraversal::next):
3030         (WebCore::Layout::LayoutBoxTraversal::nextSkippingChildren):
3031         (WebCore::Layout::Traversal::firstChild):
3032         (WebCore::Layout::Traversal::nextSibling):
3033         (WebCore::Layout::Traversal::previousSibling):
3034         (WebCore::Layout::Traversal::findAncestorOfType):
3035         (WebCore::Layout::Traversal::firstWithin):
3036         (WebCore::Layout::Traversal::next):
3037         (WebCore::Layout::LayoutIterator<T>::traversePreviousSibling):
3038         (WebCore::Layout::LayoutIterator<T>::traverseAncestor):
3039         (WebCore::Layout::Traversal::nextAncestorSibling): Deleted.
3040         (WebCore::Layout::Traversal::nextWithin): Deleted.
3041
3042 2018-05-21  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3043
3044         [Curl] Bugfix for r231968, Suspend/Resume with WK2
3045         https://bugs.webkit.org/show_bug.cgi?id=185830
3046
3047         The flags are needed to be updated even if it is cancelled or finished to cleanup correctly.
3048         Also fixed trivial bug for very rare case (hard to produce the situation).
3049
3050         Reviewed by Youenn Fablet.
3051
3052         No new tests because WK2 is not ready for WinCairo yet in public., tested internaly.
3053
3054         * platform/network/curl/CurlRequest.cpp:
3055         (WebCore::CurlRequest::suspend):
3056         (WebCore::CurlRequest::resume):
3057         (WebCore::CurlRequest::pausedStatusChanged):
3058
3059 2018-05-21  Commit Queue  <commit-queue@webkit.org>
3060
3061         Unreviewed, rolling out r232030.
3062         https://bugs.webkit.org/show_bug.cgi?id=185850
3063
3064         "Caused
3065         TestWebKitAPI.IndexedDB.StructuredCloneBackwardCompatibility
3066         API test to fail" (Requested by cdumez on #webkit).
3067
3068         Reverted changeset:
3069
3070         "File's structured serialization should serialize lastModified
3071         attribute"
3072         https://bugs.webkit.org/show_bug.cgi?id=185773
3073         https://trac.webkit.org/changeset/232030
3074
3075 2018-05-21  Daniel Bates  <dabates@apple.com>
3076
3077         REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR
3078         https://bugs.webkit.org/show_bug.cgi?id=185789
3079         <rdar://problem/40380175>
3080
3081         Reviewed by Andy Estes.
3082
3083         Fixes an issue where CSP report-only policies were ignored for DocumentThreadableLoader and
3084         PingLoad initiated loads as a result of moving CSP processing to NetworkProcess.
3085
3086         Have NetworkLoadChecker implement the ContentSecurityPolicyClient interface and support logging
3087         console messages, sending CSP reports, and dispatching SecurityPolicyViolation events. To support
3088         the latter we introduce a new WebPage message, EnqueueSecurityPolicyViolationEvent, to enqueue
3089         a SecurityPolicyViolationEvent created from an event init dictionary on the document's event
3090         dispatch queue.
3091
3092         Additionally, shorten the description for a ResourceError caused by CSP to "Blocked by Content Security Policy"
3093         because the CSP code run in NetworkProcess can now log its more detailed error description to
3094         Web Inspector.
3095
3096         Tests: http/tests/security/contentSecurityPolicy/connect-src-beacon-allowed.html
3097                http/tests/security/contentSecurityPolicy/connect-src-beacon-blocked.html
3098                http/tests/security/contentSecurityPolicy/report-only-connect-src-beacon-redirect-blocked.php
3099                http/tests/security/contentSecurityPolicy/report-only-connect-src-xmlhttprequest-redirect-to-blocked.php
3100
3101         * WebCore.xcodeproj/project.pbxproj: Change SecurityPolicyViolationEvent.h from a project header to
3102         a private header so that we can include it in WebKit code.
3103         * dom/Document.cpp:
3104         (WebCore::Document::enqueueSecurityPolicyViolationEvent): Added.
3105         * dom/Document.h:
3106
3107         * dom/EventInit.h:
3108         (WebCore::EventInit::encode const):
3109         (WebCore::EventInit::decode
3110         * dom/SecurityPolicyViolationEvent.h:
3111         (WebCore::SecurityPolicyViolationEvent::Init::encode const):
3112         (WebCore::SecurityPolicyViolationEvent::Init::decode):
3113         Support encoding and decoding for the event.
3114
3115         * loader/DocumentLoader.cpp:
3116         (WebCore::DocumentLoader::enqueueSecurityPolicyViolationEvent): Formerly named "dispatchSecurityPolicyViolationEvent".
3117         (WebCore::DocumentLoader::dispatchSecurityPolicyViolationEvent): Deleted; renamed to "enqueueSecurityPolicyViolationEvent".
3118         * loader/DocumentLoader.h:
3119
3120         * loader/DocumentThreadableLoader.cpp:
3121         (WebCore::DocumentThreadableLoader::redirectReceived): While I am here, move the check for whether the loader
3122         strategy took responsibility for performing security checks to be before we perform the CSP check to avoid doing
3123         such CSP checks twice in the case that the loader strategy already did them.
3124         (WebCore::DocumentThreadableLoader::didFail): Remove code that checked the CSP policy if the load failed. When
3125         the loader strategy (NetworkProcess) is responsible for performing security checks then this code would never
3126         be executed for a violation of a CSP report-only policy because the loader does not and should not fail the load
3127         for a report-only violations. As the name implies, a report-only violation is only reported. That is, it is not
3128         enforced such that the load is blocked; => fail the load.
3129         (WebCore::DocumentThreadableLoader::reportContentSecurityPolicyError): Update the error description to more
3130         accurately describe the error and be consistent with the error message used in NetworkProcess. This error
3131         message is shown for a redirect blocked by CSP regardless of whether the redirect was to a same-origin or
3132         cross-origin resource. I chose to make the error message more vague than necessary for simplicity because
3133         the CSP code will log a more detailed message for this error than could ever be captured by error message
3134         for the ResourceError. Also use ASCIILiteral to efficiently construct the String object for the error
3135         message.
3136
3137         * page/csp/ContentSecurityPolicy.cpp:
3138         (WebCore::ContentSecurityPolicy::reportViolation const): Build up a SecurityPolicyViolationEvent::Init and
3139         pass that to the delegate to dispatch.
3140         * page/csp/ContentSecurityPolicy.h: Export allowScriptFromSource() and allowChildContextFromSource() so that
3141         we can call them from WebKit.
3142         * page/csp/ContentSecurityPolicyClient.h: Update for renaming.
3143         * platform/network/ResourceRequestBase.h: Define a new requester type to be able to differentiate a request
3144         initiated by importScripts() from other requests. We use this to perform the appropriate CSP checks in NetworkProcess.
3145         * workers/WorkerScriptLoader.cpp:
3146         (WebCore::WorkerScriptLoader::loadSynchronously): Set the requester on the ResourceRequest to ResourceRequest::Requester::ImportScripts
3147         so that we can differentiate this request from other requests. See remark for file ResourceRequestBase.h for
3148         more details.
3149
3150 2018-05-21  Chris Dumez  <cdumez@apple.com>
3151
3152         File's structured serialization should serialize lastModified attribute
3153         https://bugs.webkit.org/show_bug.cgi?id=185773
3154
3155         Reviewed by Youenn Fablet.
3156
3157         Update our implementation for the stuctured serialization of a File to include
3158         its lastModified attribute, as per:
3159         - https://w3c.github.io/FileAPI/#file-section
3160
3161         No new tests, rebaselined existing test.
3162
3163         * bindings/js/SerializedScriptValue.cpp:
3164         (WebCore::CloneSerializer::write):
3165         (WebCore::CloneDeserializer::readFile):
3166         * fileapi/File.cpp:
3167         (WebCore::File::File):
3168         * fileapi/File.h:
3169
3170 2018-05-21  Jer Noble  <jer.noble@apple.com>
3171
3172         Complete fix for enabling modern EME by default
3173         https://bugs.webkit.org/show_bug.cgi?id=185770
3174         <rdar://problem/40368220>
3175
3176         Reviewed by Eric Carlson.
3177
3178         * Configurations/FeatureDefines.xcconfig:
3179
3180 2018-05-21  Olivier Blin  <olivier.blin@softathome.com>
3181
3182         [CMake][WebCore] fix sqlite include dir variable
3183         https://bugs.webkit.org/show_bug.cgi?id=185825
3184
3185         Reviewed by Konstantin Tokarev.
3186
3187         WebCore's CMakeLists.txt used SQLITE_INCLUDE_DIRS, but only SQLITE_INCLUDE_DIR is defined.
3188
3189         No new tests, build fix only.
3190
3191         * CMakeLists.txt: Use SQLITE_INCLUDE_DIR instead of SQLITE_INCLUDE_DIRS.
3192
3193 2018-05-21  Olivier Blin  <olivier.blin@softathome.com>
3194
3195         Propagate WebCore system include dirs in WebCoreHeaderInterface
3196         https://bugs.webkit.org/show_bug.cgi?id=185822
3197
3198         Reviewed by Michael Catanzaro.
3199
3200         System include directories from WebCore are not propagated anymore to its users.
3201         For example gcrypt, sqlite and ICU system headers defined in PAL are not properly passed to WebKit build.
3202
3203         This may have been caused partly by the fix in r230385:
3204         [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
3205         https://bugs.webkit.org/show_bug.cgi?id=184127
3206
3207         No new tests, build fix.
3208
3209         * CMakeLists.txt:
3210
3211 2018-05-21  Olivier Blin  <olivier.blin@softathome.com>
3212
3213         Fix FrameLoader build without video
3214         https://bugs.webkit.org/show_bug.cgi?id=185821
3215
3216         Reviewed by Michael Catanzaro.
3217
3218         Regression(r231392): Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
3219         https://bugs.webkit.org/show_bug.cgi?id=185288
3220
3221         No new tests, build fix only.
3222
3223         * loader/FrameLoader.cpp:
3224         (WebCore::FrameLoader::checkCompleted): Flag HTMLMediaElement::isRunningDestructor() usage.
3225
3226 2018-05-21  Sam Weinig  <sam@webkit.org>
3227
3228         Modernize RenderStyleConstants.h - Part 1
3229         https://bugs.webkit.org/show_bug.cgi?id=185809
3230
3231         Reviewed by Yusuke Suzuki.
3232             
3233         Modernized the first set of enums in RenderStyleConstants.h by:
3234             - Converting them to enum classes
3235             - Renaming them to remove unnecessary prefix 'E's
3236             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
3237             - Renaming to match modern conventions (e.g BNONE -> None)
3238             - Reformatting them so that each value is on its own line.
3239
3240         Modernizes the following enums:
3241             PrintColorAdjust
3242             StyleDifference
3243             StyleDifferenceContextSensitiveProperty
3244             ColumnFill
3245             ColumnSpan
3246             BorderCollapse (renamed from EBorderCollapse)
3247             BorderStyle (renamed from EBorderStyle)
3248             BorderPrecedence (renamed from EBorderPrecedence)
3249             OutlineIsAuto
3250             PositionType (renamed from EPosition)
3251             Float (renamed from EFloat)
3252             MarginCollapse (renamed from EMarginCollapse)
3253             BoxDecorationBreak (renamed from EBoxDecorationBreak)
3254             BoxSizing (renamed from EBoxSizing)
3255             Overflow (renamed from EOverflow)
3256             VerticalAlign (renamed from EVerticalAlign)
3257             Clear (renamed from EClear)
3258             TableLayoutType (renamed from ETableLayout)
3259             TextCombine
3260             FillAttachment (renamed from EFillAttachment)
3261             FillBox (renamed from EFillBox)
3262             FillRepeat (renamed from EFillRepeat)
3263             FillLayerType (renamed from EFillLayerType)
3264             FillSizeType (renamed from EFillSizeType)
3265             MaskSourceType (renamed from EMaskSourceType)
3266             BoxPack (renamed from EBoxPack)
3267             BoxAlignment (renamed from EBoxAlignment)
3268             BoxOrient (renamed from EBoxOrient)
3269             BoxLines (renamed from EBoxLines)
3270             BoxDirection (renamed from EBoxDirection)
3271             AlignContent (renamed from EAlignContent)
3272             FlexDirection (renamed from EFlexDirection)
3273             FlexWrap (renamed from EFlexWrap)
3274             ItemPosition
3275             OverflowAlignment
3276             ItemPositionType
3277             ContentPosition
3278             ContentDistribution (renamed from ContentDistributionType)
3279             TextSecurity (renamed from ETextSecurity)
3280             UserModify (renamed from EUserModify)
3281             UserDrag (renamed from EUserDrag)
3282             UserSelect (renamed from EUserSelect)
3283             ObjectFit
3284             AspectRatioType
3285             WordBreak (renamed from EWordBreak)
3286             OverflowWrap (renamed from EOverflowWrap)
3287             NBSPMode (renamed from ENBSPMode)
3288             LineBreak
3289             Resize (renamed from EResize)
3290             QuoteType
3291             TransformStyle3D (renamed from ETransformStyle3D)
3292             BackfaceVisibility (renamed from EBackfaceVisibility)
3293             LineClamp (renamed from ELineClamp)
3294             TextOverflow
3295             ImageRendering (renamed from EImageRendering)
3296             TextIndentLine
3297             TextIndentType
3298             Isolation
3299
3300         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3301         (AXAttributeStringSetStyle):
3302         * css/BasicShapeFunctions.cpp:
3303         (WebCore::valueForCenterCoordinate):
3304         (WebCore::valueForBasicShape):
3305         * css/CSSComputedStyleDeclaration.cpp:
3306         (WebCore::sizingBox):
3307         (WebCore::fillRepeatToCSSValue):
3308         (WebCore::fillSourceTypeToCSSValue):
3309         (WebCore::fillSizeToCSSValue):
3310         (WebCore::valueForItemPositionWithOverflowAlignment):
3311         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
3312         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3313         * css/CSSPrimitiveValueMappings.h:
3314         (WebCore::CSSPrimitiveValue::operator LineClampValue const):
3315         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3316         (WebCore::CSSPrimitiveValue::operator ColumnFill const):
3317         (WebCore::CSSPrimitiveValue::operator ColumnSpan const):
3318         (WebCore::CSSPrimitiveValue::operator PrintColorAdjust const):
3319         (WebCore::CSSPrimitiveValue::operator BorderStyle const):
3320         (WebCore::CSSPrimitiveValue::operator OutlineIsAuto const):
3321         (WebCore::CSSPrimitiveValue::operator BackfaceVisibility const):
3322         (WebCore::CSSPrimitiveValue::operator FillAttachment const):
3323         (WebCore::CSSPrimitiveValue::operator FillBox const):
3324         (WebCore::CSSPrimitiveValue::operator FillRepeat const):
3325         (WebCore::CSSPrimitiveValue::operator BoxPack const):
3326         (WebCore::CSSPrimitiveValue::operator BoxAlignment const):
3327         (WebCore::CSSPrimitiveValue::operator BoxDecorationBreak const):
3328         (WebCore::CSSPrimitiveValue::operator BoxSizing const):
3329         (WebCore::CSSPrimitiveValue::operator BoxDirection const):
3330         (WebCore::CSSPrimitiveValue::operator BoxLines const):
3331         (WebCore::CSSPrimitiveValue::operator BoxOrient const):
3332         (WebCore::CSSPrimitiveValue::operator Clear const):
3333         (WebCore::CSSPrimitiveValue::operator FlexDirection const):
3334         (WebCore::CSSPrimitiveValue::operator AlignContent const):
3335         (WebCore::CSSPrimitiveValue::operator FlexWrap const):
3336         (WebCore::CSSPrimitiveValue::operator Float const):
3337         (WebCore::CSSPrimitiveValue::operator LineBreak const):
3338         (WebCore::CSSPrimitiveValue::operator MarginCollapse const):
3339         (WebCore::CSSPrimitiveValue::operator NBSPMode const):
3340         (WebCore::CSSPrimitiveValue::operator Overflow const):
3341         (WebCore::CSSPrimitiveValue::operator PositionType const):
3342         (WebCore::CSSPrimitiveValue::operator Resize const):
3343         (WebCore::CSSPrimitiveValue::operator TableLayoutType const):
3344         (WebCore::CSSPrimitiveValue::operator TextSecurity const):
3345         (WebCore::CSSPrimitiveValue::operator UserDrag const):
3346         (WebCore::CSSPrimitiveValue::operator UserModify const):
3347         (WebCore::CSSPrimitiveValue::operator UserSelect const):
3348         (WebCore::CSSPrimitiveValue::operator VerticalAlign const):
3349         (WebCore::CSSPrimitiveValue::operator WordBreak const):
3350         (WebCore::CSSPrimitiveValue::operator OverflowWrap const):
3351         (WebCore::CSSPrimitiveValue::operator TextCombine const):
3352         (WebCore::CSSPrimitiveValue::operator TextOverflow const):
3353         (WebCore::CSSPrimitiveValue::operator ObjectFit const):
3354         (WebCore::CSSPrimitiveValue::operator Isolation const):
3355         (WebCore::CSSPrimitiveValue::operator BorderCollapse const):
3356         (WebCore::CSSPrimitiveValue::operator ImageRendering const):
3357         (WebCore::CSSPrimitiveValue::operator TransformStyle3D const):
3358         (WebCore::CSSPrimitiveValue::operator ItemPosition const):
3359         (WebCore::CSSPrimitiveValue::operator OverflowAlignment const):
3360         (WebCore::CSSPrimitiveValue::operator ContentPosition const):
3361         (WebCore::CSSPrimitiveValue::operator ContentDistribution const):
3362         (WebCore::CSSPrimitiveValue::operator EBorderStyle const): Deleted.
3363         (WebCore::CSSPrimitiveValue::operator EBackfaceVisibility const): Deleted.
3364         (WebCore::CSSPrimitiveValue::operator EFillAttachment const): Deleted.
3365         (WebCore::CSSPrimitiveValue::operator EFillBox const): Deleted.
3366         (WebCore::CSSPrimitiveValue::operator EFillRepeat const): Deleted.
3367         (WebCore::CSSPrimitiveValue::operator EBoxPack const): Deleted.
3368         (WebCore::CSSPrimitiveValue::operator